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