- Revision
- 249562
- Author
- cdu...@apple.com
- Date
- 2019-09-05 21:51:31 -0700 (Thu, 05 Sep 2019)
Log Message
Stop using testRunner.setPrivateBrowsingEnabled_DEPRECATED() in http/tests/cache/disk-cache/disk-cache-vary-cookie.html
https://bugs.webkit.org/show_bug.cgi?id=201524
Reviewed by Alex Christensen.
Stop using testRunner.setPrivateBrowsingEnabled_DEPRECATED() as it does not do the right thing for WebKit2.
Instead, use the new useEphemeralSession WKTR flag added in r249542.
* http/tests/cache/disk-cache/disk-cache-vary-cookie-expected.txt:
* http/tests/cache/disk-cache/disk-cache-vary-cookie-private-expected.txt: Added.
* http/tests/cache/disk-cache/disk-cache-vary-cookie-private.html: Copied from LayoutTests/http/tests/cache/disk-cache/disk-cache-vary-cookie.html.
* http/tests/cache/disk-cache/disk-cache-vary-cookie.html:
Modified Paths
Added Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (249561 => 249562)
--- trunk/LayoutTests/ChangeLog 2019-09-06 04:37:10 UTC (rev 249561)
+++ trunk/LayoutTests/ChangeLog 2019-09-06 04:51:31 UTC (rev 249562)
@@ -1,5 +1,20 @@
2019-09-05 Chris Dumez <cdu...@apple.com>
+ Stop using testRunner.setPrivateBrowsingEnabled_DEPRECATED() in http/tests/cache/disk-cache/disk-cache-vary-cookie.html
+ https://bugs.webkit.org/show_bug.cgi?id=201524
+
+ Reviewed by Alex Christensen.
+
+ Stop using testRunner.setPrivateBrowsingEnabled_DEPRECATED() as it does not do the right thing for WebKit2.
+ Instead, use the new useEphemeralSession WKTR flag added in r249542.
+
+ * http/tests/cache/disk-cache/disk-cache-vary-cookie-expected.txt:
+ * http/tests/cache/disk-cache/disk-cache-vary-cookie-private-expected.txt: Added.
+ * http/tests/cache/disk-cache/disk-cache-vary-cookie-private.html: Copied from LayoutTests/http/tests/cache/disk-cache/disk-cache-vary-cookie.html.
+ * http/tests/cache/disk-cache/disk-cache-vary-cookie.html:
+
+2019-09-05 Chris Dumez <cdu...@apple.com>
+
Stop using testRunner.setPrivateBrowsingEnabled_DEPRECATED() in plugins/private-browsing-mode.html
https://bugs.webkit.org/show_bug.cgi?id=201523
Modified: trunk/LayoutTests/http/tests/cache/disk-cache/disk-cache-vary-cookie-expected.txt (249561 => 249562)
--- trunk/LayoutTests/http/tests/cache/disk-cache/disk-cache-vary-cookie-expected.txt 2019-09-06 04:37:10 UTC (rev 249561)
+++ trunk/LayoutTests/http/tests/cache/disk-cache/disk-cache-vary-cookie-expected.txt 2019-09-06 04:51:31 UTC (rev 249562)
@@ -61,35 +61,6 @@
response headers: {"Vary":"Cookie","Cache-control":"max-age=100"}
response source: Memory cache
-Testing memory cache in private browsing
-Setting cookie and loading
-response headers: {"Cache-control":"max-age=100"}
-response source: Network
-
-response headers: {"Vary":"Cookie","Cache-control":"max-age=100"}
-response source: Network
-
-Loading again
-response headers: {"Cache-control":"max-age=100"}
-response source: Memory cache
-
-response headers: {"Vary":"Cookie","Cache-control":"max-age=100"}
-response source: Memory cache
-
-Changing cookie and loading
-response headers: {"Cache-control":"max-age=100"}
-response source: Memory cache
-
-response headers: {"Vary":"Cookie","Cache-control":"max-age=100"}
-response source: Network
-
-Loading again
-response headers: {"Cache-control":"max-age=100"}
-response source: Memory cache
-
-response headers: {"Vary":"Cookie","Cache-control":"max-age=100"}
-response source: Memory cache
-
PASS successfullyParsed is true
TEST COMPLETE
Added: trunk/LayoutTests/http/tests/cache/disk-cache/disk-cache-vary-cookie-private-expected.txt (0 => 249562)
--- trunk/LayoutTests/http/tests/cache/disk-cache/disk-cache-vary-cookie-private-expected.txt (rev 0)
+++ trunk/LayoutTests/http/tests/cache/disk-cache/disk-cache-vary-cookie-private-expected.txt 2019-09-06 04:51:31 UTC (rev 249562)
@@ -0,0 +1,39 @@
+Test that Vary: Cookie in response is handled by caches.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Testing disk cache
+Testing memory cache in private browsing
+Setting cookie and loading
+response headers: {"Cache-control":"max-age=100"}
+response source: Network
+
+response headers: {"Vary":"Cookie","Cache-control":"max-age=100"}
+response source: Network
+
+Loading again
+response headers: {"Cache-control":"max-age=100"}
+response source: Memory cache
+
+response headers: {"Vary":"Cookie","Cache-control":"max-age=100"}
+response source: Memory cache
+
+Changing cookie and loading
+response headers: {"Cache-control":"max-age=100"}
+response source: Memory cache
+
+response headers: {"Vary":"Cookie","Cache-control":"max-age=100"}
+response source: Network
+
+Loading again
+response headers: {"Cache-control":"max-age=100"}
+response source: Memory cache
+
+response headers: {"Vary":"Cookie","Cache-control":"max-age=100"}
+response source: Memory cache
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Copied: trunk/LayoutTests/http/tests/cache/disk-cache/disk-cache-vary-cookie-private.html (from rev 249561, trunk/LayoutTests/http/tests/cache/disk-cache/disk-cache-vary-cookie.html) (0 => 249562)
--- trunk/LayoutTests/http/tests/cache/disk-cache/disk-cache-vary-cookie-private.html (rev 0)
+++ trunk/LayoutTests/http/tests/cache/disk-cache/disk-cache-vary-cookie-private.html 2019-09-06 04:51:31 UTC (rev 249562)
@@ -0,0 +1,46 @@
+<!-- webkit-test-runner [ useEphemeralSession=true ] -->
+<script src=""
+<script src=""
+<body>
+<script>
+
+
+description("Test that Vary: Cookie in response is handled by caches.");
+
+function testCookies(testDiskCache, completionHandler)
+{
+ var tests = [
+ { responseHeaders: {'Cache-control': 'max-age=100'} },
+ { responseHeaders: {'Vary': 'Cookie', 'Cache-control': 'max-age=100'} },
+ ];
+
+ var options = { "ClearMemoryCache" : testDiskCache };
+ debug("Setting cookie and loading");
+ document.cookie = "cookie=" + Math.floor((Math.random() * 1000000000000));
+ loadResourcesWithOptions(tests, options, function () {
+ printResults(tests);
+ debug("Loading again");
+ loadResourcesWithOptions(tests, options, function () {
+ printResults(tests);
+ debug("Changing cookie and loading");
+ document.cookie = "cookie" + Math.floor((Math.random() * 1000000000000));
+ loadResourcesWithOptions(tests, options, function () {
+ printResults(tests);
+ debug("Loading again");
+ loadResourcesWithOptions(tests, options, function () {
+ printResults(tests);
+ completionHandler();
+ });
+ });
+ });
+ });
+}
+
+debug("Testing disk cache");
+debug("Testing memory cache in private browsing");
+testCookies(false, function () {
+ finishJSTest();
+});
+
+</script>
+<script src=""
Modified: trunk/LayoutTests/http/tests/cache/disk-cache/disk-cache-vary-cookie.html (249561 => 249562)
--- trunk/LayoutTests/http/tests/cache/disk-cache/disk-cache-vary-cookie.html 2019-09-06 04:37:10 UTC (rev 249561)
+++ trunk/LayoutTests/http/tests/cache/disk-cache/disk-cache-vary-cookie.html 2019-09-06 04:51:31 UTC (rev 249562)
@@ -39,11 +39,7 @@
testCookies(true, function () {
debug("Testing memory cache");
testCookies(false, function () {
- debug("Testing memory cache in private browsing");
- testRunner.setPrivateBrowsingEnabled_DEPRECATED(true);
- testCookies(false, function () {
- finishJSTest();
- });
+ finishJSTest();
});
});