summaryrefslogtreecommitdiffstats
path: root/LayoutTests/fast/dom/DeviceOrientation/script-tests/window-property.js
diff options
context:
space:
mode:
Diffstat (limited to 'LayoutTests/fast/dom/DeviceOrientation/script-tests/window-property.js')
-rw-r--r--LayoutTests/fast/dom/DeviceOrientation/script-tests/window-property.js31
1 files changed, 31 insertions, 0 deletions
diff --git a/LayoutTests/fast/dom/DeviceOrientation/script-tests/window-property.js b/LayoutTests/fast/dom/DeviceOrientation/script-tests/window-property.js
new file mode 100644
index 0000000..e7458b4
--- /dev/null
+++ b/LayoutTests/fast/dom/DeviceOrientation/script-tests/window-property.js
@@ -0,0 +1,31 @@
+description("Tests that the window.DeviceOrientationEvent and window.ondeviceorientation properties are present.");
+
+function hasDeviceOrientationEventProperty()
+{
+ for (var property in window) {
+ if (property == "DeviceOrientationEvent")
+ return true;
+ }
+ return false;
+}
+
+shouldBeTrue("typeof window.DeviceOrientationEvent == 'function'");
+shouldBeTrue("hasDeviceOrientationEventProperty()");
+shouldBeTrue("'DeviceOrientationEvent' in window");
+shouldBeTrue("window.hasOwnProperty('DeviceOrientationEvent')");
+
+function hasOnDeviceOrientationProperty()
+{
+ for (var property in window) {
+ if (property == "ondeviceorientation")
+ return true;
+ }
+ return false;
+}
+
+shouldBeTrue("typeof window.ondeviceorientation == 'object'");
+shouldBeTrue("hasOnDeviceOrientationProperty()");
+shouldBeTrue("'ondeviceorientation' in window");
+shouldBeFalse("window.hasOwnProperty('ondeviceorientation')");
+
+window.successfullyParsed = true;