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