Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / dom / DeviceOrientation / basic-operation.html
blob671e9aa7488bf3e8173f92a6919bd8ec7b2274d9
1 <!DOCTYPE html>
2 <html>
3 <body>
4 <script src="../../../resources/js-test.js"></script>
5 <script>
6 description('Tests the basic operation of DeviceOrientation using the mock.');
8 var mockAlpha = 1.1;
9 var mockBeta = 2.2;
10 var mockGamma = 3.3;
11 var mockAbsolute = true;
13 if (window.testRunner)
14 testRunner.setMockDeviceOrientation(true, mockAlpha, true, mockBeta, true, mockGamma, true, mockAbsolute);
15 else
16 debug('This test can not be run without the TestRunner');
18 var deviceOrientationEvent;
19 window.addEventListener('deviceorientation', function(e) {
20 deviceOrientationEvent = e;
21 shouldBe('deviceOrientationEvent.alpha', 'mockAlpha');
22 shouldBe('deviceOrientationEvent.beta', 'mockBeta');
23 shouldBe('deviceOrientationEvent.gamma', 'mockGamma');
24 shouldBe('deviceOrientationEvent.absolute', 'mockAbsolute');
25 finishJSTest();
26 });
28 window.jsTestIsAsync = true;
29 </script>
30 </body>
31 </html>