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

Unified Diff: LayoutTests/fast/dom/DeviceOrientation/script-tests/multiple-frames.js

Issue 22599005: Blink-side layout tests for the new Device Orientation API. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebased once more Created 7 years, 3 months 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: LayoutTests/fast/dom/DeviceOrientation/script-tests/multiple-frames.js
diff --git a/LayoutTests/fast/dom/DeviceOrientation/script-tests/multiple-frames.js b/LayoutTests/fast/dom/DeviceOrientation/script-tests/multiple-frames.js
index 3536aaef46e68e2fccd1c4b69a027974517b7d14..1c823af655cf5511cef3736c341ebd43a106a288 100644
--- a/LayoutTests/fast/dom/DeviceOrientation/script-tests/multiple-frames.js
+++ b/LayoutTests/fast/dom/DeviceOrientation/script-tests/multiple-frames.js
@@ -1,11 +1,18 @@
description('Tests using DeviceOrientation from multiple frames.');
+var mockEvent = {alpha: 1.1, beta: 2.2, gamma: 3.3, absolute: true};
+if (window.testRunner)
+ testRunner.setMockDeviceOrientation(true, mockEvent.alpha, true, mockEvent.beta, true, mockEvent.gamma, true, mockEvent.absolute);
+else
+ debug('This test can not be run without the TestRunner');
+
var deviceOrientationEvent;
function checkOrientation(event) {
deviceOrientationEvent = event;
shouldBe('deviceOrientationEvent.alpha', 'mockEvent.alpha');
shouldBe('deviceOrientationEvent.beta', 'mockEvent.beta');
shouldBe('deviceOrientationEvent.gamma', 'mockEvent.gamma');
+ shouldBe('deviceOrientationEvent.absolute', 'mockEvent.absolute');
}
var hasMainFrameEventFired = false;
@@ -27,12 +34,6 @@ function maybeFinishTest() {
finishJSTest();
}
-var mockEvent = {alpha: 1.1, beta: 2.2, gamma: 3.3};
-if (window.testRunner)
- testRunner.setMockDeviceOrientation(true, mockEvent.alpha, true, mockEvent.beta, true, mockEvent.gamma);
-else
- debug('This test can not be run without the TestRunner');
-
var childFrame = document.createElement('iframe');
document.body.appendChild(childFrame);
childFrame.contentWindow.addEventListener('deviceorientation', childFrameListener);

Powered by Google App Engine
This is Rietveld 408576698