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

Unified Diff: LayoutTests/fast/dom/DeviceOrientation/script-tests/updates.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/updates.js
diff --git a/LayoutTests/fast/dom/DeviceOrientation/script-tests/updates.js b/LayoutTests/fast/dom/DeviceOrientation/script-tests/updates.js
index df6a321f2c6ffdc9c980435d78727b8fad46b871..90899262a75d8d042c377499e8879543c0c9b03e 100644
--- a/LayoutTests/fast/dom/DeviceOrientation/script-tests/updates.js
+++ b/LayoutTests/fast/dom/DeviceOrientation/script-tests/updates.js
@@ -1,10 +1,10 @@
description('Tests that updates to the orientation causes new events to fire.');
var mockEvent;
-function setMockOrientation(alpha, beta, gamma) {
- mockEvent = {alpha: alpha, beta: beta, gamma: gamma};
+function setMockOrientation(alpha, beta, gamma, absolute) {
+ mockEvent = {alpha: alpha, beta: beta, gamma: gamma, absolute: absolute};
if (window.testRunner)
- testRunner.setMockDeviceOrientation(true, mockEvent.alpha, true, mockEvent.beta, true, mockEvent.gamma);
+ 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');
}
@@ -15,13 +15,17 @@ function checkOrientation(event) {
shouldBe('deviceOrientationEvent.alpha', 'mockEvent.alpha');
shouldBe('deviceOrientationEvent.beta', 'mockEvent.beta');
shouldBe('deviceOrientationEvent.gamma', 'mockEvent.gamma');
+ shouldBe('deviceOrientationEvent.absolute', 'mockEvent.absolute');
}
function firstListener(event) {
checkOrientation(event);
window.removeEventListener('deviceorientation', firstListener);
+ setTimeout(function(){initUpdateListener();}, 0);
+}
- setMockOrientation(11.1, 22.2, 33.3);
+function initUpdateListener() {
+ setMockOrientation(11.1, 22.2, 33.3, true);
window.addEventListener('deviceorientation', updateListener);
}
@@ -30,7 +34,7 @@ function updateListener(event) {
finishJSTest();
}
-setMockOrientation(1.1, 2.2, 3.3);
+setMockOrientation(1.1, 2.2, 3.3, true);
window.addEventListener('deviceorientation', firstListener);
window.jsTestIsAsync = true;

Powered by Google App Engine
This is Rietveld 408576698