summaryrefslogtreecommitdiffstats
path: root/LayoutTests
diff options
context:
space:
mode:
Diffstat (limited to 'LayoutTests')
-rw-r--r--LayoutTests/fast/dom/DeviceOrientation/basic-operation-expected.txt12
-rw-r--r--LayoutTests/fast/dom/DeviceOrientation/basic-operation.html12
-rw-r--r--LayoutTests/fast/dom/DeviceOrientation/script-tests/basic-operation.js22
3 files changed, 46 insertions, 0 deletions
diff --git a/LayoutTests/fast/dom/DeviceOrientation/basic-operation-expected.txt b/LayoutTests/fast/dom/DeviceOrientation/basic-operation-expected.txt
new file mode 100644
index 0000000..48dc123
--- /dev/null
+++ b/LayoutTests/fast/dom/DeviceOrientation/basic-operation-expected.txt
@@ -0,0 +1,12 @@
+Tests the basic operation of DeviceOrientation using the mock.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS deviceOrientationEvent.alpha is mockAlpha
+PASS deviceOrientationEvent.beta is mockBeta
+PASS deviceOrientationEvent.gamma is mockGamma
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/dom/DeviceOrientation/basic-operation.html b/LayoutTests/fast/dom/DeviceOrientation/basic-operation.html
new file mode 100644
index 0000000..4bc77ce
--- /dev/null
+++ b/LayoutTests/fast/dom/DeviceOrientation/basic-operation.html
@@ -0,0 +1,12 @@
+<html>
+<head>
+<link rel="stylesheet" href="../../js/resources/js-test-style.css">
+<script src="../../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="script-tests/basic-operation.js"></script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
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;