| <script src="../resources/js-test-pre.js"></script> |
| description('Tests the cancelVibration after changing the value of pageVisibility to hidden.'); |
| var visibilityState = document.visibilityState; |
| document.addEventListener('visibilitychange', function(e) { |
| if (document.visibilityState == 'hidden') |
| shouldBeFalse('internals.isVibrating()'); |
| testRunner.setPageVisibility(visibilityState); |
| shouldBeFalse('internals.isVibrating()'); |
| navigator.vibrate(10000); |
| shouldBeTrue('internals.isVibrating()'); |
| testRunner.setPageVisibility('hidden'); |
| debug('This test can not be run without the TestRunner'); |
| window.jsTestIsAsync = true; |
| <script src="../resources/js-test-post.js"></script> |