window-property.js revision 4e1f8b9c727ac820b633f6de547dc9afcd8da485
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 == 'function'");
13shouldBeTrue("hasDeviceOrientationEventProperty()");
14shouldBeTrue("'DeviceOrientationEvent' in window");
15shouldBeTrue("window.hasOwnProperty('DeviceOrientationEvent')");
16
17function hasOnDeviceOrientationProperty()
18{
19    for (var property in window) {
20        if (property == "ondeviceorientation")
21            return true;
22    }
23    return false;
24}
25
26shouldBeTrue("typeof window.ondeviceorientation == 'object'");
27shouldBeTrue("hasOnDeviceOrientationProperty()");
28shouldBeTrue("'ondeviceorientation' in window");
29shouldBeFalse("window.hasOwnProperty('ondeviceorientation')");
30
31window.successfullyParsed = true;
32