[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.22-985-g3c00f00
beidson at apple.com
beidson at apple.com
Wed Mar 17 18:31:51 UTC 2010
The following commit has been merged in the webkit-1.1 branch:
commit 05735c32351ab3b66c208ec6ab4b477cf543b1c1
Author: beidson at apple.com <beidson at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Wed Mar 10 21:34:58 2010 +0000
https://bugs.webkit.org/show_bug.cgi?id=35977
Reviewed by Sam Weinig.
Turns out the previous attempt to clear/reset cookies wasn't working because of the way
the URLs for the .js and its .cgi were being resolved.
So this is a better way to make the cookies consistent both before and after these tests.
If this fails to make cookie-related tests reliable, then we might have to bite the bullet
and give DRT itself the ability to forcibly remove cookies via API methods.
This would be bulletproof and could be automatic if a test declares itself "cookie sensitive"
but we'd lose the ability to reliably run these tests in the browser. :(
* http/tests/cookies/resources/resetCookies.js: Added.
* http/tests/cookies/resources/third-party-cookie-relaxing-iframe.html:
* http/tests/cookies/third-party-cookie-relaxing.html:
* http/tests/plugins/resources/third-party-cookie-accept-policy-iframe.html:
* http/tests/plugins/third-party-cookie-accept-policy.html:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55801 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index a2d4782..13bef03 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,26 @@
+2010-03-10 Brady Eidson <beidson at apple.com>
+
+ Reviewed by Sam Weinig.
+
+ https://bugs.webkit.org/show_bug.cgi?id=35977
+
+ Turns out the previous attempt to clear/reset cookies wasn't working because of the way
+ the URLs for the .js and its .cgi were being resolved.
+
+ So this is a better way to make the cookies consistent both before and after these tests.
+
+ If this fails to make cookie-related tests reliable, then we might have to bite the bullet
+ and give DRT itself the ability to forcibly remove cookies via API methods.
+
+ This would be bulletproof and could be automatic if a test declares itself "cookie sensitive"
+ but we'd lose the ability to reliably run these tests in the browser. :(
+
+ * http/tests/cookies/resources/resetCookies.js: Added.
+ * http/tests/cookies/resources/third-party-cookie-relaxing-iframe.html:
+ * http/tests/cookies/third-party-cookie-relaxing.html:
+ * http/tests/plugins/resources/third-party-cookie-accept-policy-iframe.html:
+ * http/tests/plugins/third-party-cookie-accept-policy.html:
+
2010-03-10 Antonio Gomes <tonikitoo at webkit.org>
Reviewed by Dave Hyatt.
diff --git a/LayoutTests/http/tests/cookies/resources/resetCookies.js b/LayoutTests/http/tests/cookies/resources/resetCookies.js
new file mode 100644
index 0000000..577822a
--- /dev/null
+++ b/LayoutTests/http/tests/cookies/resources/resetCookies.js
@@ -0,0 +1,18 @@
+function resetCookies()
+{
+ if (window.layoutTestController)
+ layoutTestController.setAlwaysAcceptCookies(true);
+
+ // Due to cross-origin restrictions, we can only (simply) reset cookies for our current origin.
+ var url = "http://" + window.location.hostname +":8000/cookies/resources/cookie-utility.php?queryfunction=deleteCookies";
+ var req = new XMLHttpRequest();
+ try {
+ req.open('GET', url, false);
+ req.send();
+ } catch (e) {
+ alert("Attempt to clear " + url + " cookies might have failed. Test results might be off from here on out. (" + e + ")");
+ }
+
+ if (window.layoutTestController)
+ layoutTestController.setAlwaysAcceptCookies(false);
+}
diff --git a/LayoutTests/http/tests/cookies/resources/third-party-cookie-relaxing-iframe.html b/LayoutTests/http/tests/cookies/resources/third-party-cookie-relaxing-iframe.html
index e948d8a..d16964e 100644
--- a/LayoutTests/http/tests/cookies/resources/third-party-cookie-relaxing-iframe.html
+++ b/LayoutTests/http/tests/cookies/resources/third-party-cookie-relaxing-iframe.html
@@ -1,5 +1,7 @@
<html>
+<script src="resetCookies.js"></script>
<script>
+resetCookies();
if (window.layoutTestController)
layoutTestController.dumpAsText();
@@ -12,6 +14,9 @@ window.onmessage = function(evt)
} else if (evt.data.split(" ")[0] == "sendXHR") {
sendXHR(evt.data.split(" ")[1]);
return;
+ } else if (evt.data == "resetCookiesAndNotifyDone") {
+ resetCookiesAndNotifyDone();
+ return;
} else
alert("Unknown message.");
}
@@ -40,6 +45,13 @@ function sendXHR(queryCommand)
parent.window.postMessage("done", "*");
}
+function resetCookiesAndNotifyDone()
+{
+ resetCookies();
+ if (window.layoutTestController)
+ layoutTestController.notifyDone();
+}
+
</script>
<body>
HELLO THERE
diff --git a/LayoutTests/http/tests/cookies/third-party-cookie-relaxing.html b/LayoutTests/http/tests/cookies/third-party-cookie-relaxing.html
index 64dcc21..df9c4b9 100644
--- a/LayoutTests/http/tests/cookies/third-party-cookie-relaxing.html
+++ b/LayoutTests/http/tests/cookies/third-party-cookie-relaxing.html
@@ -1,14 +1,12 @@
<html>
<head>
-<script src="resources/cookies-test-pre.js"></script>
+<script src="resources/resetCookies.js"></script>
<script>
+resetCookies();
if (window.layoutTestController) {
layoutTestController.dumpAsText();
layoutTestController.waitUntilDone();
- layoutTestController.setAlwaysAcceptCookies(true);
- clearCookies();
- layoutTestController.setAlwaysAcceptCookies(false);
}
window.onmessage = function(evt)
@@ -80,10 +78,8 @@ function runNextTestOrFinish()
{
if (currentFunction >= functions.length) {
if (window.layoutTestController) {
- layoutTestController.notifyDone();
- layoutTestController.setAlwaysAcceptCookies(true);
- clearCookies();
- layoutTestController.setAlwaysAcceptCookies(false);
+ resetCookies();
+ window.frames[0].postMessage("resetCookiesAndNotifyDone", "*");
}
return;
}
diff --git a/LayoutTests/http/tests/plugins/resources/third-party-cookie-accept-policy-iframe.html b/LayoutTests/http/tests/plugins/resources/third-party-cookie-accept-policy-iframe.html
index 9e05ead..891dbf3 100644
--- a/LayoutTests/http/tests/plugins/resources/third-party-cookie-accept-policy-iframe.html
+++ b/LayoutTests/http/tests/plugins/resources/third-party-cookie-accept-policy-iframe.html
@@ -1,6 +1,8 @@
<html>
<head>
+<script src="../../cookies/resources/resetCookies.js"></script>
<script>
+resetCookies();
if (window.layoutTestController) {
layoutTestController.dumpAsText();
@@ -30,12 +32,9 @@ function trySetCookie()
function completeTest()
{
alert("Cookies should still be clear, and are: '" + document.cookie + "'");
- if (window.layoutTestController) {
+ resetCookies();
+ if (window.layoutTestController)
layoutTestController.notifyDone();
- layoutTestController.setAlwaysAcceptCookies(true);
- clearCookies();
- layoutTestController.setAlwaysAcceptCookies(false);
- }
}
</script>
diff --git a/LayoutTests/http/tests/plugins/third-party-cookie-accept-policy.html b/LayoutTests/http/tests/plugins/third-party-cookie-accept-policy.html
index 72163b6..e08c66d 100644
--- a/LayoutTests/http/tests/plugins/third-party-cookie-accept-policy.html
+++ b/LayoutTests/http/tests/plugins/third-party-cookie-accept-policy.html
@@ -1,14 +1,12 @@
<html>
<head>
-<script src="../cookies/resources/cookies-test-pre.js"></script>
+<script src="../cookies/resources/resetCookies.js"></script>
<script>
+resetCookies();
if (window.layoutTestController) {
layoutTestController.dumpAsText();
layoutTestController.waitUntilDone();
- layoutTestController.setAlwaysAcceptCookies(true);
- clearCookies();
- layoutTestController.setAlwaysAcceptCookies(false);
}
</script>
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list