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