| 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> | 5 <script> |
| 6 description('Tests that updates to the orientation causes new events to fire.'); | 6 description('Tests that updates to the orientation causes new events to fire.'); |
| 7 | 7 |
| 8 var mockEvent; | 8 var mockEvent; |
| 9 function setMockOrientation(alpha, beta, gamma, absolute) { | 9 function setMockOrientation(alpha, beta, gamma, absolute) { |
| 10 mockEvent = {alpha: alpha, beta: beta, gamma: gamma, absolute: absolute}; | 10 mockEvent = {alpha: alpha, beta: beta, gamma: gamma, absolute: absolute}; |
| 11 if (window.testRunner) | 11 if (window.testRunner) |
| 12 testRunner.setMockDeviceOrientation(true, mockEvent.alpha, true, mockEve
nt.beta, true, mockEvent.gamma, true, mockEvent.absolute); | 12 testRunner.setMockDeviceOrientation(true, mockEvent.alpha, true, mockEve
nt.beta, true, mockEvent.gamma, mockEvent.absolute); |
| 13 else | 13 else |
| 14 debug('This test can not be run without the TestRunner'); | 14 debug('This test can not be run without the TestRunner'); |
| 15 } | 15 } |
| 16 | 16 |
| 17 var deviceOrientationEvent; | 17 var deviceOrientationEvent; |
| 18 function checkOrientation(event) { | 18 function checkOrientation(event) { |
| 19 deviceOrientationEvent = event; | 19 deviceOrientationEvent = event; |
| 20 shouldBe('deviceOrientationEvent.alpha', 'mockEvent.alpha'); | 20 shouldBe('deviceOrientationEvent.alpha', 'mockEvent.alpha'); |
| 21 shouldBe('deviceOrientationEvent.beta', 'mockEvent.beta'); | 21 shouldBe('deviceOrientationEvent.beta', 'mockEvent.beta'); |
| 22 shouldBe('deviceOrientationEvent.gamma', 'mockEvent.gamma'); | 22 shouldBe('deviceOrientationEvent.gamma', 'mockEvent.gamma'); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 39 finishJSTest(); | 39 finishJSTest(); |
| 40 } | 40 } |
| 41 | 41 |
| 42 setMockOrientation(1.1, 2.2, 3.3, true); | 42 setMockOrientation(1.1, 2.2, 3.3, true); |
| 43 window.addEventListener('deviceorientation', firstListener); | 43 window.addEventListener('deviceorientation', firstListener); |
| 44 | 44 |
| 45 window.jsTestIsAsync = true; | 45 window.jsTestIsAsync = true; |
| 46 </script> | 46 </script> |
| 47 </body> | 47 </body> |
| 48 </html> | 48 </html> |
| OLD | NEW |