Home | History | Annotate | Download | only in script-tests
      1 description('Tests the basic operation of DeviceOrientation using the mock.');
      2 
      3 var mockAlpha = 1.1;
      4 var mockBeta = 2.2;
      5 var mockGamma = 3.3;
      6 
      7 if (window.layoutTestController)
      8     layoutTestController.setMockDeviceOrientation(true, mockAlpha, true, mockBeta, true, mockGamma);
      9 else
     10     debug('This test can not be run without the LayoutTestController');
     11 
     12 var deviceOrientationEvent;
     13 window.addEventListener('deviceorientation', function(e) {
     14     deviceOrientationEvent = e;
     15     shouldBe('deviceOrientationEvent.alpha', 'mockAlpha');
     16     shouldBe('deviceOrientationEvent.beta', 'mockBeta');
     17     shouldBe('deviceOrientationEvent.gamma', 'mockGamma');
     18     finishJSTest();
     19 });
     20 
     21 window.jsTestIsAsync = true;
     22 window.successfullyParsed = true;
     23