1description('Tests the basic operation of DeviceOrientation using the mock.'); 2 3var mockAlpha = 1.1; 4var mockBeta = 2.2; 5var mockGamma = 3.3; 6 7if (window.layoutTestController) 8 layoutTestController.setMockDeviceOrientation(true, mockAlpha, true, mockBeta, true, mockGamma); 9else 10 debug('This test can not be run without the LayoutTestController'); 11 12var deviceOrientationEvent; 13window.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 21window.jsTestIsAsync = true; 22window.successfullyParsed = true; 23