summaryrefslogtreecommitdiffstats
path: root/LayoutTests/fast/dom/DeviceOrientation/script-tests/basic-operation.js
diff options
context:
space:
mode:
Diffstat (limited to 'LayoutTests/fast/dom/DeviceOrientation/script-tests/basic-operation.js')
-rw-r--r--LayoutTests/fast/dom/DeviceOrientation/script-tests/basic-operation.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/LayoutTests/fast/dom/DeviceOrientation/script-tests/basic-operation.js b/LayoutTests/fast/dom/DeviceOrientation/script-tests/basic-operation.js
new file mode 100644
index 0000000..6e68b06
--- /dev/null
+++ b/LayoutTests/fast/dom/DeviceOrientation/script-tests/basic-operation.js
@@ -0,0 +1,22 @@
+description("Tests the basic operation of DeviceOrientation using the mock.");
+
+var mockAlpha = 1.1;
+var mockBeta = 2.2;
+var mockGamma = 3.3;
+
+if (window.layoutTestController)
+ layoutTestController.setMockDeviceOrientation(true, mockAlpha, true, mockBeta, true, mockGamma);
+else
+ debug('This test can not be run without the LayoutTestController');
+
+var deviceOrientationEvent;
+window.addEventListener("deviceorientation", function(e) {
+ deviceOrientationEvent = e;
+ shouldBe('deviceOrientationEvent.alpha', 'mockAlpha');
+ shouldBe('deviceOrientationEvent.beta', 'mockBeta');
+ shouldBe('deviceOrientationEvent.gamma', 'mockGamma');
+ finishJSTest();
+});
+
+window.jsTestIsAsync = true;
+window.successfullyParsed = true;