| OLD | NEW |
| (Empty) |
| 1 <!DOCTYPE html> | |
| 2 <html> | |
| 3 <body> | |
| 4 <script src="../../../resources/js-test.js"></script> | |
| 5 <script> | |
| 6 description("Tests that the window.DeviceMotionEvent and window.ondevicemotion p
roperties are present."); | |
| 7 | |
| 8 function hasDeviceMotionEventProperty() | |
| 9 { | |
| 10 for (var property in window) { | |
| 11 if (property == "DeviceMotionEvent") | |
| 12 return true; | |
| 13 } | |
| 14 return false; | |
| 15 } | |
| 16 | |
| 17 shouldBeTrue("typeof window.DeviceMotionEvent == 'object'"); | |
| 18 shouldBeFalse("typeof window.DeviceMotionEvent == 'function'"); | |
| 19 shouldBeTrue("hasDeviceMotionEventProperty()"); | |
| 20 shouldBeTrue("'DeviceMotionEvent' in window"); | |
| 21 shouldBeTrue("window.hasOwnProperty('DeviceMotionEvent')"); | |
| 22 | |
| 23 function hasOnDeviceMotionProperty() | |
| 24 { | |
| 25 for (var property in window) { | |
| 26 if (property == "ondevicemotion") | |
| 27 return true; | |
| 28 } | |
| 29 return false; | |
| 30 } | |
| 31 | |
| 32 shouldBeTrue("typeof window.ondevicemotion == 'object'"); | |
| 33 shouldBeTrue("hasOnDeviceMotionProperty()"); | |
| 34 shouldBeTrue("'ondevicemotion' in window"); | |
| 35 shouldBeTrue("window.hasOwnProperty('ondevicemotion')"); | |
| 36 </script> | |
| 37 </body> | |
| 38 </html> | |
| OLD | NEW |