[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
steveblock at google.com
steveblock at google.com
Wed Dec 22 13:26:29 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 935305890be98967a7bb7b5ad40514fef5b8becc
Author: steveblock at google.com <steveblock at google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Wed Sep 15 15:52:58 2010 +0000
2010-09-15 Steve Block <steveblock at google.com>
Reviewed by Jeremy Orlow.
fast/dom/DeviceOrientation/add-listener-from-callback flaky
https://bugs.webkit.org/show_bug.cgi?id=45814
When we call addEventListener(), an event is sent to all registered
event listeners on that page. So in the existing test, both the calls
to setMockDeviceOrientation() and addEventListener() will trigger events
to fire asynchronously on both listeners (both will be registered by the
time the event fires), giving a total of five events. A race condition
exists as to whether the test finishes after the third event, before
the fourth event fires.
This patch fixes the problem by expecting the correct number of events
to fire. We also remove the call to setMockDeviceOrientation() as this
adds extra complication and is tested in update.html.
* fast/dom/DeviceOrientation/add-listener-from-callback-expected.txt:
* fast/dom/DeviceOrientation/script-tests/add-listener-from-callback.js:
(checkOrientation):
(firstListener):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@67557 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 1bb7352..8fc5a4c 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,27 @@
+2010-09-15 Steve Block <steveblock at google.com>
+
+ Reviewed by Jeremy Orlow.
+
+ fast/dom/DeviceOrientation/add-listener-from-callback flaky
+ https://bugs.webkit.org/show_bug.cgi?id=45814
+
+ When we call addEventListener(), an event is sent to all registered
+ event listeners on that page. So in the existing test, both the calls
+ to setMockDeviceOrientation() and addEventListener() will trigger events
+ to fire asynchronously on both listeners (both will be registered by the
+ time the event fires), giving a total of five events. A race condition
+ exists as to whether the test finishes after the third event, before
+ the fourth event fires.
+
+ This patch fixes the problem by expecting the correct number of events
+ to fire. We also remove the call to setMockDeviceOrientation() as this
+ adds extra complication and is tested in update.html.
+
+ * fast/dom/DeviceOrientation/add-listener-from-callback-expected.txt:
+ * fast/dom/DeviceOrientation/script-tests/add-listener-from-callback.js:
+ (checkOrientation):
+ (firstListener):
+
2010-09-15 Pavel Podivilov <podivilov at chromium.org>
Reviewed by Pavel Feldman.
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;
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list