Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(24)

Unified Diff: third_party/WebKit/LayoutTests/fast/dom/DeviceOrientation/resources/basic-operation.js

Issue 1416123002: Absolute Device Orientation API: blink implementation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/fast/dom/DeviceOrientation/resources/basic-operation.js
diff --git a/third_party/WebKit/LayoutTests/fast/dom/DeviceOrientation/resources/basic-operation.js b/third_party/WebKit/LayoutTests/fast/dom/DeviceOrientation/resources/basic-operation.js
new file mode 100644
index 0000000000000000000000000000000000000000..951774c394ce86caed6d95771dc1b4d7732ae6e6
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/dom/DeviceOrientation/resources/basic-operation.js
@@ -0,0 +1,22 @@
+// This test can be used to test device orientation event types: 'deviceorientation' and 'deviceorientationabsolute'.
+function testBasicOperation(eventType) {
+ window.jsTestIsAsync = true;
+ if (!window.testRunner)
+ debug('This test can not be run without the TestRunner');
+
+ mockAlpha = 1.1;
+ mockBeta = 2.2;
+ mockGamma = 3.3;
+ mockAbsolute = true;
+ testRunner.setMockDeviceOrientation(true, mockAlpha, true, mockBeta, true, mockGamma, true, mockAbsolute);
+
+ window.addEventListener(eventType, function(e) {
+ event = e;
+ shouldBe('event.alpha', 'mockAlpha');
+ shouldBe('event.beta', 'mockBeta');
+ shouldBe('event.gamma', 'mockGamma');
+ shouldBe('event.absolute', 'mockAbsolute');
+ finishJSTest();
+ });
+}
+

Powered by Google App Engine
This is Rietveld 408576698