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 to check that deviceorientation events are not fired when the
page is not visible.'); | 6 description('Tests to check that deviceorientation events are not fired when the
page is not visible.'); |
7 window.jsTestIsAsync = true; | 7 window.jsTestIsAsync = true; |
8 | 8 |
9 function succeedAndFinish() | 9 function succeedAndFinish() |
10 { | 10 { |
(...skipping 27 matching lines...) Expand all Loading... |
38 window.addEventListener('deviceorientation', failAndFinish); | 38 window.addEventListener('deviceorientation', failAndFinish); |
39 | 39 |
40 setTimeout(testWithPageVisible, 100); | 40 setTimeout(testWithPageVisible, 100); |
41 } | 41 } |
42 | 42 |
43 function deviceOrientationListener(event) { | 43 function deviceOrientationListener(event) { |
44 setTimeout(testWithPageHidden, 0); | 44 setTimeout(testWithPageHidden, 0); |
45 } | 45 } |
46 | 46 |
47 if (window.testRunner) | 47 if (window.testRunner) |
48 testRunner.setMockDeviceOrientation(true, 1, true, 2, true, 3, true, true); | 48 testRunner.setMockDeviceOrientation(true, 1, true, 2, true, 3, true); |
49 | 49 |
50 debug("* Page is visible"); | 50 debug("* Page is visible"); |
51 window.addEventListener('deviceorientation', deviceOrientationListener); | 51 window.addEventListener('deviceorientation', deviceOrientationListener); |
52 </script> | 52 </script> |
53 </body> | 53 </body> |
54 </html> | 54 </html> |
OLD | NEW |