| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <body> | 3 <body> |
| 4 <script src="../../../resources/js-test.js"></script> | 4 <script src="../../../resources/js-test.js"></script> |
| 5 <script src="resources/basic-operation.js"></script> |
| 5 <script> | 6 <script> |
| 6 description('Tests the basic operation of DeviceOrientation using the mock.'); | 7 description('Tests basic operation of the deviceorientation event using mock dat
a.'); |
| 7 | 8 testBasicOperation('deviceorientation'); |
| 8 var mockAlpha = 1.1; | |
| 9 var mockBeta = 2.2; | |
| 10 var mockGamma = 3.3; | |
| 11 var mockAbsolute = true; | |
| 12 | |
| 13 if (window.testRunner) | |
| 14 testRunner.setMockDeviceOrientation(true, mockAlpha, true, mockBeta, true, m
ockGamma, true, mockAbsolute); | |
| 15 else | |
| 16 debug('This test can not be run without the TestRunner'); | |
| 17 | |
| 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 }); | |
| 27 | |
| 28 window.jsTestIsAsync = true; | |
| 29 </script> | 9 </script> |
| 30 </body> | 10 </body> |
| 31 </html> | 11 </html> |
| OLD | NEW |