1description("Tests that the window.DeviceMotionEvent and window.ondevicemotion properties are present."); 2 3function hasDeviceMotionEventProperty() 4{ 5 for (var property in window) { 6 if (property == "DeviceMotionEvent") 7 return true; 8 } 9 return false; 10} 11 12shouldBeTrue("typeof window.DeviceMotionEvent == 'object'"); 13shouldBeFalse("typeof window.DeviceMotionEvent == 'function'"); 14shouldBeTrue("hasDeviceMotionEventProperty()"); 15shouldBeTrue("'DeviceMotionEvent' in window"); 16shouldBeTrue("window.hasOwnProperty('DeviceMotionEvent')"); 17 18function hasOnDeviceMotionProperty() 19{ 20 for (var property in window) { 21 if (property == "ondevicemotion") 22 return true; 23 } 24 return false; 25} 26 27shouldBeTrue("typeof window.ondevicemotion == 'object'"); 28shouldBeTrue("hasOnDeviceMotionProperty()"); 29shouldBeTrue("'ondevicemotion' in window"); 30shouldBeTrue("window.hasOwnProperty('ondevicemotion')"); 31 32window.successfullyParsed = true; 33