summaryrefslogtreecommitdiffstats
path: root/LayoutTests
diff options
context:
space:
mode:
authorIain Merrick <husky@google.com>2010-09-16 11:04:41 +0100
committerIain Merrick <husky@google.com>2010-09-16 12:10:44 +0100
commit2494ce79f9e4db44891bbbb36336840d3f02fbcb (patch)
treea7fa35c5fa3f670ba41b26f463bf3d127b4fa9ab /LayoutTests
parent5ff0cae98f72d38d027120bffdeaa3fe3b5afd57 (diff)
downloadexternal_webkit-2494ce79f9e4db44891bbbb36336840d3f02fbcb.zip
external_webkit-2494ce79f9e4db44891bbbb36336840d3f02fbcb.tar.gz
external_webkit-2494ce79f9e4db44891bbbb36336840d3f02fbcb.tar.bz2
Merge WebKit at r67178 : Cherry-pick fix for DeviceOrientation test.
Bug in fast/dom/DeviceOrientation/add-listener-from-callback. To ensure we get a clean merge with no LayoutTest failures, cherry-picking fix from http://trac.webkit.org/changeset/67557 Change-Id: I381b0cc695eb7f05768c30b790d66318c5369af3
Diffstat (limited to 'LayoutTests')
-rw-r--r--LayoutTests/fast/dom/DeviceOrientation/add-listener-from-callback-expected.txt18
-rw-r--r--LayoutTests/fast/dom/DeviceOrientation/script-tests/add-listener-from-callback.js26
2 files changed, 21 insertions, 23 deletions
diff --git a/LayoutTests/fast/dom/DeviceOrientation/add-listener-from-callback-expected.txt b/LayoutTests/fast/dom/DeviceOrientation/add-listener-from-callback-expected.txt
index 6bf84d4..1d2ac5a 100644
--- a/LayoutTests/fast/dom/DeviceOrientation/add-listener-from-callback-expected.txt
+++ b/LayoutTests/fast/dom/DeviceOrientation/add-listener-from-callback-expected.txt
@@ -3,15 +3,15 @@ Tests that adding a new event listener from a callback works as expected.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-PASS deviceOrientationEvent.alpha is mockEvent.alpha
-PASS deviceOrientationEvent.beta is mockEvent.beta
-PASS deviceOrientationEvent.gamma is mockEvent.gamma
-PASS deviceOrientationEvent.alpha is mockEvent.alpha
-PASS deviceOrientationEvent.beta is mockEvent.beta
-PASS deviceOrientationEvent.gamma is mockEvent.gamma
-PASS deviceOrientationEvent.alpha is mockEvent.alpha
-PASS deviceOrientationEvent.beta is mockEvent.beta
-PASS deviceOrientationEvent.gamma is mockEvent.gamma
+PASS deviceOrientationEvent.alpha is mockAlpha
+PASS deviceOrientationEvent.beta is mockBeta
+PASS deviceOrientationEvent.gamma is mockGamma
+PASS deviceOrientationEvent.alpha is mockAlpha
+PASS deviceOrientationEvent.beta is mockBeta
+PASS deviceOrientationEvent.gamma is mockGamma
+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/script-tests/add-listener-from-callback.js b/LayoutTests/fast/dom/DeviceOrientation/script-tests/add-listener-from-callback.js
index 381b89c..c9c6ac9 100644
--- a/LayoutTests/fast/dom/DeviceOrientation/script-tests/add-listener-from-callback.js
+++ b/LayoutTests/fast/dom/DeviceOrientation/script-tests/add-listener-from-callback.js
@@ -1,30 +1,29 @@
description('Tests that adding a new event listener from a callback works as expected.');
-var mockEvent;
-function setMockOrientation(alpha, beta, gamma) {
- mockEvent = {alpha: alpha, beta: beta, gamma: gamma};
- if (window.layoutTestController)
- layoutTestController.setMockDeviceOrientation(true, mockEvent.alpha, true, mockEvent.beta, true, mockEvent.gamma);
- else
- debug('This test can not be run without the LayoutTestController');
-}
+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;
function checkOrientation(event) {
deviceOrientationEvent = event;
- shouldBe('deviceOrientationEvent.alpha', 'mockEvent.alpha');
- shouldBe('deviceOrientationEvent.beta', 'mockEvent.beta');
- shouldBe('deviceOrientationEvent.gamma', 'mockEvent.gamma');
+ shouldBe('deviceOrientationEvent.alpha', 'mockAlpha');
+ shouldBe('deviceOrientationEvent.beta', 'mockBeta');
+ shouldBe('deviceOrientationEvent.gamma', 'mockGamma');
}
var firstListenerEvents = 0;
function firstListener(event) {
checkOrientation(event);
if (++firstListenerEvents == 1)
- setMockOrientation(11.1, 22.2, 33.3);
+ window.addEventListener('deviceorientation', secondListener);
else if (firstListenerEvents > 2)
testFailed('Too many events for first listener.');
- window.addEventListener('deviceorientation', secondListener);
maybeFinishTest();
}
@@ -41,7 +40,6 @@ function maybeFinishTest() {
finishJSTest();
}
-setMockOrientation(1.1, 2.2, 3.3);
window.addEventListener('deviceorientation', firstListener);
window.jsTestIsAsync = true;