Diff
Modified: trunk/LayoutTests/ChangeLog (249541 => 249542)
--- trunk/LayoutTests/ChangeLog 2019-09-05 21:01:23 UTC (rev 249541)
+++ trunk/LayoutTests/ChangeLog 2019-09-05 21:12:05 UTC (rev 249542)
@@ -1,3 +1,63 @@
+2019-09-05 Chris Dumez <cdu...@apple.com>
+
+ [WK2] Add proper layout test support for ephemeral sessions
+ https://bugs.webkit.org/show_bug.cgi?id=201475
+
+ Reviewed by Antti Koivisto.
+
+ Update existing layout tests to either switch to the new mechanism when trivial or to rename
+ setPrivateBrowsingEnabled() to setPrivateBrowsingEnabled_DEPRECATED() when it is not.
+
+ * crypto/subtle/rsa-indexeddb-non-exportable-private.html:
+ * crypto/subtle/rsa-indexeddb-private.html:
+ * http/tests/adClickAttribution/conversion-disabled-in-ephemeral-session.html:
+ * http/tests/adClickAttribution/resources/util.js:
+ (tearDownAndFinish):
+ * http/tests/adClickAttribution/store-disabled-in-ephemeral-session.html:
+ * http/tests/cache-storage/cache-persistency.https.html:
+ * http/tests/cache-storage/cache-representation.https.html:
+ * http/tests/cache/disk-cache/disk-cache-vary-cookie.html:
+ * http/tests/cookies/private-cookie-storage.html:
+ * http/tests/media/now-playing-info-private-browsing.html:
+ * http/tests/security/appcache-in-private-browsing.html:
+ * http/tests/security/appcache-switching-private-browsing.html:
+ * http/tests/security/contentSecurityPolicy/report-cross-origin-no-cookies-when-private-browsing-enabled-expected.txt:
+ * http/tests/security/contentSecurityPolicy/report-cross-origin-no-cookies-when-private-browsing-enabled.php:
+ * http/tests/security/contentSecurityPolicy/report-cross-origin-no-cookies-when-private-browsing-toggled.php:
+ * http/tests/security/contentSecurityPolicy/report-same-origin-no-cookies-when-private-browsing-toggled.php:
+ * http/tests/security/contentSecurityPolicy/report-same-origin-with-cookies-when-private-browsing-enabled-expected.txt:
+ * http/tests/security/contentSecurityPolicy/report-same-origin-with-cookies-when-private-browsing-enabled.php:
+ * http/tests/security/cookies/resources/first-party-cookie-allow.xsl:
+ * http/tests/security/cookies/resources/third-party-cookie-blocking.xsl:
+ * http/tests/security/cookies/third-party-cookie-blocking-main-frame.html:
+ * http/tests/security/cookies/third-party-cookie-blocking-redirect.html:
+ * http/tests/security/cookies/third-party-cookie-blocking-user-action.html:
+ * http/tests/security/cookies/third-party-cookie-blocking.html:
+ * http/tests/security/cross-frame-access-private-browsing.html:
+ * http/tests/security/cross-origin-plugin-private-browsing-toggled-allowed.html:
+ * http/tests/security/cross-origin-plugin-private-browsing-toggled.html:
+ * http/tests/security/private-browsing-http-auth.html:
+ * http/tests/security/storage-blocking-loosened-private-browsing-plugin.html:
+ * http/tests/security/storage-blocking-strengthened-private-browsing-plugin.html:
+ * http/tests/security/strip-referrer-to-origin-for-third-party-redirects-in-private-mode.html:
+ * http/tests/security/strip-referrer-to-origin-for-third-party-requests-in-private-mode.html:
+ * http/tests/storageAccess/has-storage-access-true-if-feature-off.html:
+ * http/tests/workers/service/resources/basic-register.js:
+ (async.test):
+ * http/tests/workers/service/serviceworker-private-browsing.https.html:
+ * http/wpt/fetch/dnt-header-after-redirection.html:
+ * platform/wk2/TestExpectations:
+ * plugins/private-browsing-mode-2.html:
+ * plugins/private-browsing-mode.html:
+ * resources/js-test.js:
+ * storage/domstorage/localstorage/private-browsing-affects-storage.html:
+ * storage/domstorage/localstorage/resources/private-browsing-1.html:
+ * storage/domstorage/localstorage/resources/private-browsing-2.html:
+ * storage/indexeddb/open-db-private-browsing.html:
+ * storage/indexeddb/resources/open-db-private-browsing.js:
+ * storage/websql/private-browsing-noread-nowrite.html:
+ * storage/websql/private-browsing-open-disabled.html:
+
2019-09-05 Justin Fan <justin_...@apple.com>
[WebGPU] Implement GPUUncapturedErrorEvent
Modified: trunk/LayoutTests/crypto/subtle/rsa-indexeddb-non-exportable-private.html (249541 => 249542)
--- trunk/LayoutTests/crypto/subtle/rsa-indexeddb-non-exportable-private.html 2019-09-05 21:01:23 UTC (rev 249541)
+++ trunk/LayoutTests/crypto/subtle/rsa-indexeddb-non-exportable-private.html 2019-09-05 21:12:05 UTC (rev 249542)
@@ -1,10 +1,7 @@
+<!-- webkit-test-runner [ useEphemeralSession=true ] -->
<!DOCTYPE html>
<html>
<head>
-<script>
-if (window.testRunner)
- testRunner.setPrivateBrowsingEnabled(true);
-</script>
<script src=""
<script src=""
</head>
Modified: trunk/LayoutTests/crypto/subtle/rsa-indexeddb-private.html (249541 => 249542)
--- trunk/LayoutTests/crypto/subtle/rsa-indexeddb-private.html 2019-09-05 21:01:23 UTC (rev 249541)
+++ trunk/LayoutTests/crypto/subtle/rsa-indexeddb-private.html 2019-09-05 21:12:05 UTC (rev 249542)
@@ -1,10 +1,7 @@
+<!-- webkit-test-runner [ useEphemeralSession=true ] -->
<!DOCTYPE html>
<html>
<head>
-<script>
-if (window.testRunner)
- testRunner.setPrivateBrowsingEnabled(true);
-</script>
<script src=""
<script src=""
</head>
Modified: trunk/LayoutTests/http/tests/adClickAttribution/conversion-disabled-in-ephemeral-session.html (249541 => 249542)
--- trunk/LayoutTests/http/tests/adClickAttribution/conversion-disabled-in-ephemeral-session.html 2019-09-05 21:01:23 UTC (rev 249541)
+++ trunk/LayoutTests/http/tests/adClickAttribution/conversion-disabled-in-ephemeral-session.html 2019-09-05 21:12:05 UTC (rev 249542)
@@ -55,7 +55,7 @@
function runTest() {
if (window.testRunner) {
if (window.location.search === "?stepTwo") {
- testRunner.setPrivateBrowsingEnabled(true);
+ testRunner.setPrivateBrowsingEnabled_DEPRECATED(true);
let imageElement = document.createElement("img");
imageElement.src = "" + nonce;
imageElement.id = "pixel";
Modified: trunk/LayoutTests/http/tests/adClickAttribution/resources/util.js (249541 => 249542)
--- trunk/LayoutTests/http/tests/adClickAttribution/resources/util.js 2019-09-05 21:01:23 UTC (rev 249541)
+++ trunk/LayoutTests/http/tests/adClickAttribution/resources/util.js 2019-09-05 21:12:05 UTC (rev 249542)
@@ -12,7 +12,6 @@
testRunner.setAllowsAnySSLCertificate(false);
testRunner.setAdClickAttributionOverrideTimerForTesting(false);
testRunner.setAdClickAttributionConversionURLForTesting("");
- testRunner.setPrivateBrowsingEnabled(false);
testRunner.notifyDone();
}
-}
\ No newline at end of file
+}
Modified: trunk/LayoutTests/http/tests/adClickAttribution/store-disabled-in-ephemeral-session.html (249541 => 249542)
--- trunk/LayoutTests/http/tests/adClickAttribution/store-disabled-in-ephemeral-session.html 2019-09-05 21:01:23 UTC (rev 249541)
+++ trunk/LayoutTests/http/tests/adClickAttribution/store-disabled-in-ephemeral-session.html 2019-09-05 21:12:05 UTC (rev 249542)
@@ -1,4 +1,4 @@
-<!DOCTYPE html> <!-- webkit-test-runner [ useFlexibleViewport=true ] -->
+<!DOCTYPE html> <!-- webkit-test-runner [ useFlexibleViewport=true useEphemeralSession=true ] -->
<html lang="en">
<head>
<meta charset="UTF-8">
@@ -13,9 +13,6 @@
<script>
prepareTest();
- if (window.testRunner)
- testRunner.setPrivateBrowsingEnabled(true);
-
function activateElement(elementID) {
var element = document.getElementById(elementID);
var centerX = element.offsetLeft + element.offsetWidth / 2;
Modified: trunk/LayoutTests/http/tests/cache/disk-cache/disk-cache-vary-cookie.html (249541 => 249542)
--- trunk/LayoutTests/http/tests/cache/disk-cache/disk-cache-vary-cookie.html 2019-09-05 21:01:23 UTC (rev 249541)
+++ trunk/LayoutTests/http/tests/cache/disk-cache/disk-cache-vary-cookie.html 2019-09-05 21:12:05 UTC (rev 249542)
@@ -40,7 +40,7 @@
debug("Testing memory cache");
testCookies(false, function () {
debug("Testing memory cache in private browsing");
- testRunner.setPrivateBrowsingEnabled(true);
+ testRunner.setPrivateBrowsingEnabled_DEPRECATED(true);
testCookies(false, function () {
finishJSTest();
});
Modified: trunk/LayoutTests/http/tests/cache-storage/cache-persistency.https.html (249541 => 249542)
--- trunk/LayoutTests/http/tests/cache-storage/cache-persistency.https.html 2019-09-05 21:01:23 UTC (rev 249541)
+++ trunk/LayoutTests/http/tests/cache-storage/cache-persistency.https.html 2019-09-05 21:12:05 UTC (rev 249542)
@@ -21,7 +21,7 @@
if (!window.internals || !window.testRunner)
return Promise.reject("Test requires internals");
- testRunner.setPrivateBrowsingEnabled(true);
+ testRunner.setPrivateBrowsingEnabled_DEPRECATED(true);
return new Promise((resolve, reject) => {
window.addEventListener("message", test.step_func((event) => {
@@ -32,7 +32,7 @@
return;
}
assert_true(event.data ="" false, "No cache object should be found");
- testRunner.setPrivateBrowsingEnabled(false);
+ testRunner.setPrivateBrowsingEnabled_DEPRECATED(false);
resolve();
}));
check.innerHTML = "<iframe src=''></iframe>";
@@ -41,7 +41,7 @@
promise_test(test => {
if (window.testRunner)
- testRunner.setPrivateBrowsingEnabled(false);
+ testRunner.setPrivateBrowsingEnabled_DEPRECATED(false);
return Promise.resolve().then(() => {
if (window.internals)
Modified: trunk/LayoutTests/http/tests/cache-storage/cache-representation.https.html (249541 => 249542)
--- trunk/LayoutTests/http/tests/cache-storage/cache-representation.https.html 2019-09-05 21:01:23 UTC (rev 249541)
+++ trunk/LayoutTests/http/tests/cache-storage/cache-representation.https.html 2019-09-05 21:12:05 UTC (rev 249542)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ useEphemeralSession=true ] -->
<!DOCTYPE html>
<html>
<head>
@@ -9,9 +10,6 @@
<body>
<div id="check"></div>
<script>
- if (window.testRunner)
- testRunner.setPrivateBrowsingEnabled(true);
-
function checkCaches(hasPersistent, hasRemoved, name, value) {
test(() => {
var results = JSON.parse(value).origins;
Modified: trunk/LayoutTests/http/tests/cookies/private-cookie-storage.html (249541 => 249542)
--- trunk/LayoutTests/http/tests/cookies/private-cookie-storage.html 2019-09-05 21:01:23 UTC (rev 249541)
+++ trunk/LayoutTests/http/tests/cookies/private-cookie-storage.html 2019-09-05 21:12:05 UTC (rev 249542)
@@ -8,7 +8,7 @@
debug("Cookies before enabling private browsing (should be key1=value1):" + document.cookie);
testCookies("key1=value1");
-if (window.testRunner) { testRunner.setPrivateBrowsingEnabled(true); }
+if (window.testRunner) { testRunner.setPrivateBrowsingEnabled_DEPRECATED(true); }
debug("Cookies after enabling private browsing (should be empty):" + document.cookie);
testCookies(""); // We're using a different cookie storage now. key1=value1 is still in the default cookie storage.
@@ -17,7 +17,7 @@
testCookies("key2=value2");
clearCookies();
-if (window.testRunner) { testRunner.setPrivateBrowsingEnabled(false); }
+if (window.testRunner) { testRunner.setPrivateBrowsingEnabled_DEPRECATED(false); }
debug("Cookies after disabling private browsing (should be key1=value1):" + document.cookie);
testCookies("key1=value1");
Modified: trunk/LayoutTests/http/tests/media/now-playing-info-private-browsing.html (249541 => 249542)
--- trunk/LayoutTests/http/tests/media/now-playing-info-private-browsing.html 2019-09-05 21:01:23 UTC (rev 249541)
+++ trunk/LayoutTests/http/tests/media/now-playing-info-private-browsing.html 2019-09-05 21:12:05 UTC (rev 249542)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ useEphemeralSession=true ] -->
<!DOCTYPE html>
<html>
<head>
@@ -9,9 +10,6 @@
let nowPlayingState;
let previousNowPlayingState;
- if (window.testRunner)
- testRunner.setPrivateBrowsingEnabled(true);
-
async function waitForAttributeToChange(attribute, expected) {
let start = new Date().getTime();
do {
Modified: trunk/LayoutTests/http/tests/security/appcache-in-private-browsing.html (249541 => 249542)
--- trunk/LayoutTests/http/tests/security/appcache-in-private-browsing.html 2019-09-05 21:01:23 UTC (rev 249541)
+++ trunk/LayoutTests/http/tests/security/appcache-in-private-browsing.html 2019-09-05 21:12:05 UTC (rev 249542)
@@ -8,15 +8,13 @@
}
function finishTest(frame) {
- if (window.testRunner) {
- testRunner.setPrivateBrowsingEnabled(false);
+ if (window.testRunner)
testRunner.notifyDone();
- }
}
function enterPrivateBrowsing(frame) {
if (window.testRunner)
- testRunner.setPrivateBrowsingEnabled(true);
+ testRunner.setPrivateBrowsingEnabled_DEPRECATED(true);
frame._onload_ = finishTest;
frame.contentWindow.location.reload();
}
Modified: trunk/LayoutTests/http/tests/security/appcache-switching-private-browsing.html (249541 => 249542)
--- trunk/LayoutTests/http/tests/security/appcache-switching-private-browsing.html 2019-09-05 21:01:23 UTC (rev 249541)
+++ trunk/LayoutTests/http/tests/security/appcache-switching-private-browsing.html 2019-09-05 21:12:05 UTC (rev 249542)
@@ -10,11 +10,11 @@
function enterPrivateBrowsing(frame) {
if (window.testRunner)
- testRunner.setPrivateBrowsingEnabled(true);
+ testRunner.setPrivateBrowsingEnabled_DEPRECATED(true);
frame.contentWindow.appCacheCallback = function(result) {
frame.contentWindow.updateAppCache(function(result) {
- if (window.testRunner)
- testRunner.setPrivateBrowsingEnabled(false);
+ if (window.testRunner)
+ testRunner.setPrivateBrowsingEnabled_DEPRECATED(false);
console.log(result ? 'FAIL' : 'PASS');
if (window.testRunner)
testRunner.notifyDone();
Modified: trunk/LayoutTests/http/tests/security/contentSecurityPolicy/report-cross-origin-no-cookies-when-private-browsing-enabled-expected.txt (249541 => 249542)
--- trunk/LayoutTests/http/tests/security/contentSecurityPolicy/report-cross-origin-no-cookies-when-private-browsing-enabled-expected.txt 2019-09-05 21:01:23 UTC (rev 249541)
+++ trunk/LayoutTests/http/tests/security/contentSecurityPolicy/report-cross-origin-no-cookies-when-private-browsing-enabled-expected.txt 2019-09-05 21:12:05 UTC (rev 249542)
@@ -1,3 +1,4 @@
+CONSOLE MESSAGE: Refused to load http://127.0.0.1:8000/security/resources/abe.png because it does not appear in the img-src directive of the Content Security Policy.
CSP report received:
CONTENT_TYPE: application/csp-report
HTTP_HOST: localhost:8080
Modified: trunk/LayoutTests/http/tests/security/contentSecurityPolicy/report-cross-origin-no-cookies-when-private-browsing-enabled.php (249541 => 249542)
--- trunk/LayoutTests/http/tests/security/contentSecurityPolicy/report-cross-origin-no-cookies-when-private-browsing-enabled.php 2019-09-05 21:01:23 UTC (rev 249541)
+++ trunk/LayoutTests/http/tests/security/contentSecurityPolicy/report-cross-origin-no-cookies-when-private-browsing-enabled.php 2019-09-05 21:12:05 UTC (rev 249542)
@@ -1,13 +1,11 @@
<?php
header("Content-Security-Policy: img-src 'none'; report-uri http://localhost:8080/security/contentSecurityPolicy/resources/save-report.php");
?>
+<!-- webkit-test-runner [ useEphemeralSession=true ] -->
<!DOCTYPE html>
<html>
<body>
<script>
- if (window.testRunner)
- testRunner.setPrivateBrowsingEnabled(true);
-
var xhr = new XMLHttpRequest();
xhr.open("GET", "http://localhost:8080/cookies/resources/setCookies.cgi", false);
xhr.setRequestHeader("SET-COOKIE", "hello=world;path=/");
Modified: trunk/LayoutTests/http/tests/security/contentSecurityPolicy/report-cross-origin-no-cookies-when-private-browsing-toggled.php (249541 => 249542)
--- trunk/LayoutTests/http/tests/security/contentSecurityPolicy/report-cross-origin-no-cookies-when-private-browsing-toggled.php 2019-09-05 21:01:23 UTC (rev 249541)
+++ trunk/LayoutTests/http/tests/security/contentSecurityPolicy/report-cross-origin-no-cookies-when-private-browsing-toggled.php 2019-09-05 21:12:05 UTC (rev 249542)
@@ -12,7 +12,7 @@
xhr.send(null);
if (window.testRunner)
- testRunner.setPrivateBrowsingEnabled(true);
+ testRunner.setPrivateBrowsingEnabled_DEPRECATED(true);
</script>
<!-- This image will generate a CSP violation report. -->
Modified: trunk/LayoutTests/http/tests/security/contentSecurityPolicy/report-same-origin-no-cookies-when-private-browsing-toggled.php (249541 => 249542)
--- trunk/LayoutTests/http/tests/security/contentSecurityPolicy/report-same-origin-no-cookies-when-private-browsing-toggled.php 2019-09-05 21:01:23 UTC (rev 249541)
+++ trunk/LayoutTests/http/tests/security/contentSecurityPolicy/report-same-origin-no-cookies-when-private-browsing-toggled.php 2019-09-05 21:12:05 UTC (rev 249542)
@@ -12,7 +12,7 @@
xhr.send(null);
if (window.testRunner)
- testRunner.setPrivateBrowsingEnabled(true);
+ testRunner.setPrivateBrowsingEnabled_DEPRECATED(true);
</script>
<!-- This image will generate a CSP violation report. -->
Modified: trunk/LayoutTests/http/tests/security/contentSecurityPolicy/report-same-origin-with-cookies-when-private-browsing-enabled-expected.txt (249541 => 249542)
--- trunk/LayoutTests/http/tests/security/contentSecurityPolicy/report-same-origin-with-cookies-when-private-browsing-enabled-expected.txt 2019-09-05 21:01:23 UTC (rev 249541)
+++ trunk/LayoutTests/http/tests/security/contentSecurityPolicy/report-same-origin-with-cookies-when-private-browsing-enabled-expected.txt 2019-09-05 21:12:05 UTC (rev 249542)
@@ -1,3 +1,4 @@
+CONSOLE MESSAGE: Refused to load http://127.0.0.1:8000/security/resources/abe.png because it does not appear in the img-src directive of the Content Security Policy.
CSP report received:
CONTENT_TYPE: application/csp-report
HTTP_COOKIE: hello=world
Modified: trunk/LayoutTests/http/tests/security/contentSecurityPolicy/report-same-origin-with-cookies-when-private-browsing-enabled.php (249541 => 249542)
--- trunk/LayoutTests/http/tests/security/contentSecurityPolicy/report-same-origin-with-cookies-when-private-browsing-enabled.php 2019-09-05 21:01:23 UTC (rev 249541)
+++ trunk/LayoutTests/http/tests/security/contentSecurityPolicy/report-same-origin-with-cookies-when-private-browsing-enabled.php 2019-09-05 21:12:05 UTC (rev 249542)
@@ -1,13 +1,11 @@
<?php
header("Content-Security-Policy: img-src 'none'; report-uri /security/contentSecurityPolicy/resources/save-report.php");
?>
+<!-- webkit-test-runner [ useEphemeralSession=true ] -->
<!DOCTYPE html>
<html>
<body>
<script>
- if (window.testRunner)
- testRunner.setPrivateBrowsingEnabled(true);
-
var xhr = new XMLHttpRequest();
xhr.open("GET", "/cookies/resources/setCookies.cgi", false);
xhr.setRequestHeader("SET-COOKIE", "hello=world;path=/");
Modified: trunk/LayoutTests/http/tests/security/cookies/resources/first-party-cookie-allow.xsl (249541 => 249542)
--- trunk/LayoutTests/http/tests/security/cookies/resources/first-party-cookie-allow.xsl 2019-09-05 21:01:23 UTC (rev 249541)
+++ trunk/LayoutTests/http/tests/security/cookies/resources/first-party-cookie-allow.xsl 2019-09-05 21:12:05 UTC (rev 249542)
@@ -8,12 +8,6 @@
testRunner.waitUntilDone();
testRunner.dumpAsText();
testRunner.dumpChildFramesAsText();
-
- // Start with a clean state, as otherwise an expired cookie for this domain could affect behavior with CFNetwork.
- // Can be removed once rdar://problem/10080130 is fixed.
- if (testRunner.setPrivateBrowsingEnabled)
- testRunner.setPrivateBrowsingEnabled(true);
-
testRunner.setAlwaysAcceptCookies(false);
}
</script>
Modified: trunk/LayoutTests/http/tests/security/cookies/resources/third-party-cookie-blocking.xsl (249541 => 249542)
--- trunk/LayoutTests/http/tests/security/cookies/resources/third-party-cookie-blocking.xsl 2019-09-05 21:01:23 UTC (rev 249541)
+++ trunk/LayoutTests/http/tests/security/cookies/resources/third-party-cookie-blocking.xsl 2019-09-05 21:12:05 UTC (rev 249542)
@@ -8,12 +8,6 @@
testRunner.waitUntilDone();
testRunner.dumpAsText();
testRunner.dumpChildFramesAsText();
-
- // Start with a clean state, as otherwise an expired cookie for this domain could affect behavior with CFNetwork.
- // Can be removed once rdar://problem/10080130 is fixed.
- if (testRunner.setPrivateBrowsingEnabled)
- testRunner.setPrivateBrowsingEnabled(true);
-
testRunner.setAlwaysAcceptCookies(false);
}
</script>
Modified: trunk/LayoutTests/http/tests/security/cookies/third-party-cookie-blocking-main-frame.html (249541 => 249542)
--- trunk/LayoutTests/http/tests/security/cookies/third-party-cookie-blocking-main-frame.html 2019-09-05 21:01:23 UTC (rev 249541)
+++ trunk/LayoutTests/http/tests/security/cookies/third-party-cookie-blocking-main-frame.html 2019-09-05 21:12:05 UTC (rev 249542)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ useEphemeralSession=true ] -->
<!DOCTYPE html>
<html>
<title>Checks that a POST resulting in a main frame navigation is not affected by third-party cookie rules</title>
@@ -6,12 +7,6 @@
testRunner.waitUntilDone();
testRunner.dumpAsText();
testRunner.dumpChildFramesAsText();
-
- // Start with a clean state, as otherwise an expired cookie for this domain could affect behavior with CFNetwork.
- // Can be removed once <rdar://problem/10080130> is fixed.
- if (testRunner.setPrivateBrowsingEnabled)
- testRunner.setPrivateBrowsingEnabled(true);
-
testRunner.setAlwaysAcceptCookies(false);
}
Modified: trunk/LayoutTests/http/tests/security/cookies/third-party-cookie-blocking-redirect.html (249541 => 249542)
--- trunk/LayoutTests/http/tests/security/cookies/third-party-cookie-blocking-redirect.html 2019-09-05 21:01:23 UTC (rev 249541)
+++ trunk/LayoutTests/http/tests/security/cookies/third-party-cookie-blocking-redirect.html 2019-09-05 21:12:05 UTC (rev 249542)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ useEphemeralSession=true ] -->
<!DOCTYPE html>
<script>
function test() {
@@ -9,10 +10,6 @@
testRunner.waitUntilDone();
testRunner.dumpAsText();
testRunner.dumpChildFramesAsText();
-
- if (testRunner.setPrivateBrowsingEnabled)
- testRunner.setPrivateBrowsingEnabled(true);
-
testRunner.setAlwaysAcceptCookies(false);
}
</script>
Modified: trunk/LayoutTests/http/tests/security/cookies/third-party-cookie-blocking-user-action.html (249541 => 249542)
--- trunk/LayoutTests/http/tests/security/cookies/third-party-cookie-blocking-user-action.html 2019-09-05 21:01:23 UTC (rev 249541)
+++ trunk/LayoutTests/http/tests/security/cookies/third-party-cookie-blocking-user-action.html 2019-09-05 21:12:05 UTC (rev 249542)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ useEphemeralSession=true ] -->
<!DOCTYPE html>
<html>
<title>Checks that a user generated POST request does not circumvent third-party cookie rules</title>
@@ -8,12 +9,6 @@
testRunner.waitUntilDone();
testRunner.dumpAsText();
testRunner.dumpChildFramesAsText();
-
- // Start with a clean state, as otherwise an expired cookie for this domain could affect behavior with CFNetwork.
- // Can be removed once <rdar://problem/10080130> is fixed.
- if (testRunner.setPrivateBrowsingEnabled)
- testRunner.setPrivateBrowsingEnabled(true);
-
testRunner.setAlwaysAcceptCookies(false);
}
Modified: trunk/LayoutTests/http/tests/security/cookies/third-party-cookie-blocking.html (249541 => 249542)
--- trunk/LayoutTests/http/tests/security/cookies/third-party-cookie-blocking.html 2019-09-05 21:01:23 UTC (rev 249541)
+++ trunk/LayoutTests/http/tests/security/cookies/third-party-cookie-blocking.html 2019-09-05 21:12:05 UTC (rev 249542)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ useEphemeralSession=true ] -->
<!DOCTYPE html>
<html>
<title>Checks that a script generated POST request does not circumvent third-party cookie rules</title>
@@ -7,11 +8,6 @@
testRunner.dumpAsText();
testRunner.dumpChildFramesAsText();
- // Start with a clean state, as otherwise an expired cookie for this domain could affect behavior with CFNetwork.
- // Can be removed once <rdar://problem/10080130> is fixed.
- if (testRunner.setPrivateBrowsingEnabled)
- testRunner.setPrivateBrowsingEnabled(true);
-
testRunner.setAlwaysAcceptCookies(false);
}
Modified: trunk/LayoutTests/http/tests/security/cross-frame-access-private-browsing.html (249541 => 249542)
--- trunk/LayoutTests/http/tests/security/cross-frame-access-private-browsing.html 2019-09-05 21:01:23 UTC (rev 249541)
+++ trunk/LayoutTests/http/tests/security/cross-frame-access-private-browsing.html 2019-09-05 21:12:05 UTC (rev 249542)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ useEphemeralSession=true ] -->
<html>
<head>
<script src=""
@@ -25,7 +26,6 @@
function runTest() {
var subFrame = window.frames[0];
- testRunner.setPrivateBrowsingEnabled(true);
try {
log("Attempting to violate the same-origin policy with private browsing enabled. If this succeeds the console should not log the violation.");
Modified: trunk/LayoutTests/http/tests/security/cross-origin-plugin-private-browsing-toggled-allowed.html (249541 => 249542)
--- trunk/LayoutTests/http/tests/security/cross-origin-plugin-private-browsing-toggled-allowed.html 2019-09-05 21:01:23 UTC (rev 249541)
+++ trunk/LayoutTests/http/tests/security/cross-origin-plugin-private-browsing-toggled-allowed.html 2019-09-05 21:12:05 UTC (rev 249542)
@@ -5,7 +5,7 @@
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.dumpChildFramesAsText();
- testRunner.setPrivateBrowsingEnabled(true);
+ testRunner.setPrivateBrowsingEnabled_DEPRECATED(true);
testRunner.waitUntilDone();
}
@@ -13,7 +13,7 @@
--frames;
if (!frames) {
if (window.testRunner)
- testRunner.setPrivateBrowsingEnabled(false);
+ testRunner.setPrivateBrowsingEnabled_DEPRECATED(false);
for (var i = 0; i < 2; ++i) {
var frame = document.getElementsByTagName('iframe')[i].contentWindow;
frame.postMessage('loaded', '*');
Modified: trunk/LayoutTests/http/tests/security/cross-origin-plugin-private-browsing-toggled.html (249541 => 249542)
--- trunk/LayoutTests/http/tests/security/cross-origin-plugin-private-browsing-toggled.html 2019-09-05 21:01:23 UTC (rev 249541)
+++ trunk/LayoutTests/http/tests/security/cross-origin-plugin-private-browsing-toggled.html 2019-09-05 21:12:05 UTC (rev 249542)
@@ -5,7 +5,7 @@
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.dumpChildFramesAsText();
- testRunner.setPrivateBrowsingEnabled(true);
+ testRunner.setPrivateBrowsingEnabled_DEPRECATED(true);
testRunner.waitUntilDone();
internals.settings.setStorageBlockingPolicy('BlockThirdParty');
}
@@ -14,7 +14,7 @@
--frames;
if (!frames) {
if (window.testRunner)
- testRunner.setPrivateBrowsingEnabled(false);
+ testRunner.setPrivateBrowsingEnabled_DEPRECATED(false);
for (var i = 0; i < 2; ++i) {
var frame = document.getElementsByTagName('iframe')[i].contentWindow;
frame.postMessage('loaded', '*');
Modified: trunk/LayoutTests/http/tests/security/private-browsing-http-auth.html (249541 => 249542)
--- trunk/LayoutTests/http/tests/security/private-browsing-http-auth.html 2019-09-05 21:01:23 UTC (rev 249541)
+++ trunk/LayoutTests/http/tests/security/private-browsing-http-auth.html 2019-09-05 21:12:05 UTC (rev 249542)
@@ -6,7 +6,7 @@
testRunner.setHandlesAuthenticationChallenges(true);
testRunner.setAuthenticationUsername("webkit");
testRunner.setAuthenticationPassword("rocks");
- testRunner.setPrivateBrowsingEnabled(true);
+ testRunner.setPrivateBrowsingEnabled_DEPRECATED(true);
testRunner.waitUntilDone();
}
@@ -13,7 +13,7 @@
function firstFrameLoaded() {
if (window.testRunner) {
testRunner.setHandlesAuthenticationChallenges(false);
- testRunner.setPrivateBrowsingEnabled(false);
+ testRunner.setPrivateBrowsingEnabled_DEPRECATED(false);
}
// If the username and password were in the WebCore CredentialStorage, WebKit would automatically send them out for this resource.
Modified: trunk/LayoutTests/http/tests/security/storage-blocking-loosened-private-browsing-plugin.html (249541 => 249542)
--- trunk/LayoutTests/http/tests/security/storage-blocking-loosened-private-browsing-plugin.html 2019-09-05 21:01:23 UTC (rev 249541)
+++ trunk/LayoutTests/http/tests/security/storage-blocking-loosened-private-browsing-plugin.html 2019-09-05 21:12:05 UTC (rev 249542)
@@ -10,7 +10,7 @@
function decrement() {
if (window.testRunner) {
- testRunner.setPrivateBrowsingEnabled(true);
+ testRunner.setPrivateBrowsingEnabled_DEPRECATED(true);
internals.settings.setStorageBlockingPolicy('AllowAll');
}
for (var i = 0; i < window.frames.length; ++i)
@@ -18,10 +18,8 @@
}
window._onmessage_ = function() {
- if (window.testRunner) {
+ if (window.testRunner)
testRunner.notifyDone();
- testRunner.setPrivateBrowsingEnabled(false);
- }
}
</script>
</head>
Modified: trunk/LayoutTests/http/tests/security/storage-blocking-strengthened-private-browsing-plugin.html (249541 => 249542)
--- trunk/LayoutTests/http/tests/security/storage-blocking-strengthened-private-browsing-plugin.html 2019-09-05 21:01:23 UTC (rev 249541)
+++ trunk/LayoutTests/http/tests/security/storage-blocking-strengthened-private-browsing-plugin.html 2019-09-05 21:12:05 UTC (rev 249542)
@@ -5,13 +5,13 @@
testRunner.waitUntilDone();
testRunner.dumpAsText();
testRunner.dumpChildFramesAsText();
- testRunner.setPrivateBrowsingEnabled(true);
+ testRunner.setPrivateBrowsingEnabled_DEPRECATED(true);
}
function decrement() {
if (window.testRunner) {
internals.settings.setStorageBlockingPolicy('BlockAll');
- testRunner.setPrivateBrowsingEnabled(false);
+ testRunner.setPrivateBrowsingEnabled_DEPRECATED(false);
}
for (var i = 0; i < window.frames.length; ++i)
window.frames[i].postMessage('blocked', '*');
Modified: trunk/LayoutTests/http/tests/security/strip-referrer-to-origin-for-third-party-redirects-in-private-mode.html (249541 => 249542)
--- trunk/LayoutTests/http/tests/security/strip-referrer-to-origin-for-third-party-redirects-in-private-mode.html 2019-09-05 21:01:23 UTC (rev 249541)
+++ trunk/LayoutTests/http/tests/security/strip-referrer-to-origin-for-third-party-redirects-in-private-mode.html 2019-09-05 21:12:05 UTC (rev 249542)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ useEphemeralSession=true ] -->
<!DOCTYPE html>
<html>
<head>
@@ -8,7 +9,6 @@
description("Tests that only the origin is sent as referrer for third-party redirects in private browsing mode.");
jsTestIsAsync = true;
- testRunner.setPrivateBrowsingEnabled(true);
testRunner.dumpChildFramesAsText();
function openIframe(url, onLoadHandler) {
Modified: trunk/LayoutTests/http/tests/security/strip-referrer-to-origin-for-third-party-requests-in-private-mode.html (249541 => 249542)
--- trunk/LayoutTests/http/tests/security/strip-referrer-to-origin-for-third-party-requests-in-private-mode.html 2019-09-05 21:01:23 UTC (rev 249541)
+++ trunk/LayoutTests/http/tests/security/strip-referrer-to-origin-for-third-party-requests-in-private-mode.html 2019-09-05 21:12:05 UTC (rev 249542)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ useEphemeralSession=true ] -->
<!DOCTYPE html>
<html>
<head>
@@ -8,7 +9,6 @@
description("Tests that only the origin is sent as referrer for third-party resources in private browsing mode.");
jsTestIsAsync = true;
- testRunner.setPrivateBrowsingEnabled(true);
testRunner.dumpChildFramesAsText();
function openIframe(url, onLoadHandler) {
Modified: trunk/LayoutTests/http/tests/storageAccess/has-storage-access-true-if-feature-off.html (249541 => 249542)
--- trunk/LayoutTests/http/tests/storageAccess/has-storage-access-true-if-feature-off.html 2019-09-05 21:01:23 UTC (rev 249541)
+++ trunk/LayoutTests/http/tests/storageAccess/has-storage-access-true-if-feature-off.html 2019-09-05 21:12:05 UTC (rev 249542)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ useEphemeralSession=true ] -->
<!DOCTYPE html>
<html>
<head>
@@ -8,9 +9,6 @@
description("Tests that document.hasStorageAccess() returns true for a 3rd-party iframe if there is no way to request access (feature off).");
jsTestIsAsync = true;
- if (window.testRunner)
- testRunner.setPrivateBrowsingEnabled(true);
-
window.addEventListener("message", receiveMessage, false);
function receiveMessage(event) {
@@ -38,4 +36,4 @@
</head>
<body _onload_="runTest()">
</body>
-</html>
\ No newline at end of file
+</html>
Modified: trunk/LayoutTests/http/tests/workers/service/resources/basic-register.js (249541 => 249542)
--- trunk/LayoutTests/http/tests/workers/service/resources/basic-register.js 2019-09-05 21:01:23 UTC (rev 249541)
+++ trunk/LayoutTests/http/tests/workers/service/resources/basic-register.js 2019-09-05 21:12:05 UTC (rev 249542)
@@ -10,7 +10,7 @@
else
log("FAIL: A service worker is initially registered for this origin");
- testRunner.setPrivateBrowsingEnabled(true);
+ testRunner.setPrivateBrowsingEnabled_DEPRECATED(true);
if (!await internals.hasServiceWorkerRegistration(self.origin))
log("PASS: No service worker is initially registered for this origin in private session");
@@ -17,7 +17,7 @@
else
log("FAIL: A service worker is initially registered for this origin in private session");
- testRunner.setPrivateBrowsingEnabled(false);
+ testRunner.setPrivateBrowsingEnabled_DEPRECATED(false);
try {
r = await navigator.serviceWorker.register("resources/empty-worker.js", { scope: "/workers/service/resources/test", updateViaCache: "none" })
log("Registered!");
@@ -37,7 +37,7 @@
else
log("FAIL: No service worker is registered for this origin");
- testRunner.setPrivateBrowsingEnabled(true);
+ testRunner.setPrivateBrowsingEnabled_DEPRECATED(true);
if (!await internals.hasServiceWorkerRegistration("/test"))
log("PASS: No service worker is registered for this origin in private session");
@@ -44,7 +44,7 @@
else
log("FAIL: A service worker is registered for this origin in private session");
- testRunner.setPrivateBrowsingEnabled(false);
+ testRunner.setPrivateBrowsingEnabled_DEPRECATED(false);
} catch (e) {
log("Exception registering: " + e);
}
Modified: trunk/LayoutTests/http/tests/workers/service/serviceworker-private-browsing.https.html (249541 => 249542)
--- trunk/LayoutTests/http/tests/workers/service/serviceworker-private-browsing.https.html 2019-09-05 21:01:23 UTC (rev 249541)
+++ trunk/LayoutTests/http/tests/workers/service/serviceworker-private-browsing.https.html 2019-09-05 21:12:05 UTC (rev 249542)
@@ -14,7 +14,7 @@
if (!window.testRunner)
return Promise.reject("test requires internals API");
- testRunner.setPrivateBrowsingEnabled(true);
+ testRunner.setPrivateBrowsingEnabled_DEPRECATED(true);
var registration = await navigator.serviceWorker.getRegistration(scope);
if (registration && registration.scope === scope)
Modified: trunk/LayoutTests/http/wpt/fetch/dnt-header-after-redirection.html (249541 => 249542)
--- trunk/LayoutTests/http/wpt/fetch/dnt-header-after-redirection.html 2019-09-05 21:01:23 UTC (rev 249541)
+++ trunk/LayoutTests/http/wpt/fetch/dnt-header-after-redirection.html 2019-09-05 21:12:05 UTC (rev 249542)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ useEphemeralSession=true ] -->
<!DOCTYPE html>
<html>
<head>
@@ -28,9 +29,7 @@
return false;
}
-if (window.testRunner)
- testRunner.setPrivateBrowsingEnabled(true);
-else
+if (!window.testRunner)
alert("Make sure to run this test in Private Browsing Mode");
promise_test(async (test) => {
Modified: trunk/LayoutTests/imported/w3c/ChangeLog (249541 => 249542)
--- trunk/LayoutTests/imported/w3c/ChangeLog 2019-09-05 21:01:23 UTC (rev 249541)
+++ trunk/LayoutTests/imported/w3c/ChangeLog 2019-09-05 21:12:05 UTC (rev 249542)
@@ -1,3 +1,12 @@
+2019-09-05 Chris Dumez <cdu...@apple.com>
+
+ [WK2] Add proper layout test support for ephemeral sessions
+ https://bugs.webkit.org/show_bug.cgi?id=201475
+
+ Reviewed by Antti Koivisto.
+
+ * IndexedDB-private-browsing/support.js:
+
2019-09-05 Youenn Fablet <you...@apple.com>
Introduce WorkerSWClientConnection to make SWClientConnection mono-thread
Modified: trunk/LayoutTests/imported/w3c/IndexedDB-private-browsing/support.js (249541 => 249542)
--- trunk/LayoutTests/imported/w3c/IndexedDB-private-browsing/support.js 2019-09-05 21:01:23 UTC (rev 249541)
+++ trunk/LayoutTests/imported/w3c/IndexedDB-private-browsing/support.js 2019-09-05 21:12:05 UTC (rev 249542)
@@ -1,7 +1,8 @@
// WebKit changes: this file is the same as "IndexedDB/support.js" found in W3C web-platform-tests repo,
// except for the following lines that activate private browsing
+// FIXME: Update WKTR / DRT to enable private browsing for this folder instead.
if (window.testRunner)
- testRunner.setPrivateBrowsingEnabled(true);
+ testRunner.setPrivateBrowsingEnabled_DEPRECATED(true);
//End of WebKit changes
var databaseName = "database";
Modified: trunk/LayoutTests/platform/mac-wk2/TestExpectations (249541 => 249542)
--- trunk/LayoutTests/platform/mac-wk2/TestExpectations 2019-09-05 21:01:23 UTC (rev 249541)
+++ trunk/LayoutTests/platform/mac-wk2/TestExpectations 2019-09-05 21:12:05 UTC (rev 249542)
@@ -477,15 +477,11 @@
### START OF (5) Features that are not supported when NetworkProcess is enabled (i.e. they only work on Mountain Lion, and not on newer OS versions).
# https://bugs.webkit.org/show_bug.cgi?id=115274
-# PPT: testRunner.setPrivateBrowsingEnabled doesn't work with NetworkProcess
+# PPT: testRunner.setPrivateBrowsingEnabled_DEPRECATED() doesn't work with NetworkProcess
http/tests/security/appcache-in-private-browsing.html [ Skip ]
http/tests/security/appcache-switching-private-browsing.html [ Skip ]
http/tests/security/cookies/first-party-cookie-allow-xslt.xml [ Skip ]
-http/tests/security/cookies/third-party-cookie-blocking-main-frame.html [ Skip ]
-http/tests/security/cookies/third-party-cookie-blocking-user-action.html [ Skip ]
http/tests/security/cookies/third-party-cookie-blocking-xslt.xml [ Skip ]
-http/tests/security/cookies/third-party-cookie-blocking.html [ Skip ]
-http/tests/security/cross-frame-access-private-browsing.html [ Skip ]
http/tests/security/cross-origin-plugin-private-browsing-toggled-allowed.html [ Skip ]
http/tests/security/cross-origin-plugin-private-browsing-toggled.html [ Skip ]
http/tests/security/storage-blocking-loosened-private-browsing-plugin.html [ Skip ]
Modified: trunk/LayoutTests/platform/wk2/TestExpectations (249541 => 249542)
--- trunk/LayoutTests/platform/wk2/TestExpectations 2019-09-05 21:01:23 UTC (rev 249541)
+++ trunk/LayoutTests/platform/wk2/TestExpectations 2019-09-05 21:12:05 UTC (rev 249542)
@@ -678,13 +678,11 @@
# Skip tests in fast/text/shaping
fast/text/shaping
-# WebKitTestRunner testRunner.setPrivateBrowsingEnabled doesn't work with NetworkProcess.
+# WebKitTestRunner testRunner.setPrivateBrowsingEnabled_DEPRECATED() doesn't work with NetworkProcess.
# We explicitly Skip the following tests instead of marking them as Failure because some of these tests will naturally pass
-# as a consequence of testRunner.setPrivateBrowsingEnabled() effectively being a no-op as of the time of writing (07/08/2015).
-webkit.org/b/115274 http/tests/security/contentSecurityPolicy/report-cross-origin-no-cookies-when-private-browsing-enabled.php [ Skip ]
+# as a consequence of testRunner.setPrivateBrowsingEnabled_DEPRECATED() effectively being a no-op as of the time of writing (07/08/2015).
webkit.org/b/115274 http/tests/security/contentSecurityPolicy/report-cross-origin-no-cookies-when-private-browsing-toggled.php [ Skip ]
webkit.org/b/115274 http/tests/security/contentSecurityPolicy/report-same-origin-no-cookies-when-private-browsing-toggled.php [ Skip ]
-webkit.org/b/115274 http/tests/security/contentSecurityPolicy/report-same-origin-with-cookies-when-private-browsing-enabled.php [ Skip ]
### END OF (4) Features that are not supported in WebKit2 and likely never will be
########################################
Modified: trunk/LayoutTests/plugins/private-browsing-mode-2.html (249541 => 249542)
--- trunk/LayoutTests/plugins/private-browsing-mode-2.html 2019-09-05 21:01:23 UTC (rev 249541)
+++ trunk/LayoutTests/plugins/private-browsing-mode-2.html 2019-09-05 21:12:05 UTC (rev 249542)
@@ -20,7 +20,7 @@
shouldBe("plugin1.privateBrowsingEnabled", "false");
// Now enable private browsing
- testRunner.setPrivateBrowsingEnabled(true);
+ testRunner.setPrivateBrowsingEnabled_DEPRECATED(true);
shouldBe("plugin1.privateBrowsingEnabled", "true");
@@ -30,7 +30,7 @@
document.body.appendChild(plugin2);
shouldBe("plugin2.privateBrowsingEnabled", "true");
- testRunner.setPrivateBrowsingEnabled(false);
+ testRunner.setPrivateBrowsingEnabled_DEPRECATED(false);
shouldBe("plugin1.privateBrowsingEnabled", "false");
shouldBe("plugin2.privateBrowsingEnabled", "false");
}
Modified: trunk/LayoutTests/plugins/private-browsing-mode.html (249541 => 249542)
--- trunk/LayoutTests/plugins/private-browsing-mode.html 2019-09-05 21:01:23 UTC (rev 249541)
+++ trunk/LayoutTests/plugins/private-browsing-mode.html 2019-09-05 21:12:05 UTC (rev 249542)
@@ -21,7 +21,7 @@
shouldBe("plugin1.cachedPrivateBrowsingEnabled", "false");
// Now enable private browsing
- testRunner.setPrivateBrowsingEnabled(true);
+ testRunner.setPrivateBrowsingEnabled_DEPRECATED(true);
shouldBe("plugin1.privateBrowsingEnabled", "true");
shouldBe("plugin1.cachedPrivateBrowsingEnabled", "true");
Modified: trunk/LayoutTests/resources/js-test.js (249541 => 249542)
--- trunk/LayoutTests/resources/js-test.js 2019-09-05 21:01:23 UTC (rev 249541)
+++ trunk/LayoutTests/resources/js-test.js 2019-09-05 21:12:05 UTC (rev 249542)
@@ -6,8 +6,9 @@
testRunner.dumpAsText();
// If the test file URL ends in "-private.html", enable private browsing.
+ // FIXME: Update WKTR / DRT to do this automatically based on the test name.
if (window.location.href.endsWith("-private.html") || self.enablePrivateBrowsing)
- testRunner.setPrivateBrowsingEnabled(true);
+ testRunner.setPrivateBrowsingEnabled_DEPRECATED(true);
}
var description, debug, didFailSomeTests, successfullyParsed;
Modified: trunk/LayoutTests/storage/domstorage/localstorage/private-browsing-affects-storage.html (249541 => 249542)
--- trunk/LayoutTests/storage/domstorage/localstorage/private-browsing-affects-storage.html 2019-09-05 21:01:23 UTC (rev 249541)
+++ trunk/LayoutTests/storage/domstorage/localstorage/private-browsing-affects-storage.html 2019-09-05 21:12:05 UTC (rev 249542)
@@ -22,7 +22,7 @@
localStorage.setItem("testItem", "Persistent item!");
log("Persistent localStorage testItem is: " + localStorage.getItem("testItem"));
- testRunner.setPrivateBrowsingEnabled(true);
+ testRunner.setPrivateBrowsingEnabled_DEPRECATED(true);
testRunner.setCanOpenWindows();
window.location.href = ""
Modified: trunk/LayoutTests/storage/domstorage/localstorage/resources/private-browsing-1.html (249541 => 249542)
--- trunk/LayoutTests/storage/domstorage/localstorage/resources/private-browsing-1.html 2019-09-05 21:01:23 UTC (rev 249541)
+++ trunk/LayoutTests/storage/domstorage/localstorage/resources/private-browsing-1.html 2019-09-05 21:12:05 UTC (rev 249542)
@@ -19,7 +19,7 @@
log("Back in parent window, localStorage's length is: " + localStorage.length);
log("Back in parent window, testItem is: " + localStorage.getItem("testItem"));
- testRunner.setPrivateBrowsingEnabled(false);
+ testRunner.setPrivateBrowsingEnabled_DEPRECATED(false);
window.location.href = ""
}
Modified: trunk/LayoutTests/storage/domstorage/localstorage/resources/private-browsing-2.html (249541 => 249542)
--- trunk/LayoutTests/storage/domstorage/localstorage/resources/private-browsing-2.html 2019-09-05 21:01:23 UTC (rev 249541)
+++ trunk/LayoutTests/storage/domstorage/localstorage/resources/private-browsing-2.html 2019-09-05 21:12:05 UTC (rev 249542)
@@ -14,7 +14,7 @@
return;
}
- testRunner.setPrivateBrowsingEnabled(true);
+ testRunner.setPrivateBrowsingEnabled_DEPRECATED(true);
log("localStorage's length is: " + localStorage.length);
log("The item in new window starts out as: " + localStorage.getItem("testItem"));
Modified: trunk/LayoutTests/storage/indexeddb/open-db-private-browsing.html (249541 => 249542)
--- trunk/LayoutTests/storage/indexeddb/open-db-private-browsing.html 2019-09-05 21:01:23 UTC (rev 249541)
+++ trunk/LayoutTests/storage/indexeddb/open-db-private-browsing.html 2019-09-05 21:12:05 UTC (rev 249542)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ useEphemeralSession=true ] -->
<html>
<head>
<script src=""
Modified: trunk/LayoutTests/storage/indexeddb/resources/open-db-private-browsing.js (249541 => 249542)
--- trunk/LayoutTests/storage/indexeddb/resources/open-db-private-browsing.js 2019-09-05 21:01:23 UTC (rev 249541)
+++ trunk/LayoutTests/storage/indexeddb/resources/open-db-private-browsing.js 2019-09-05 21:12:05 UTC (rev 249542)
@@ -5,7 +5,6 @@
description("Simple test to open IndexedDB database in private browsing mode.");
-testRunner.setPrivateBrowsingEnabled(true);
removeVendorPrefixes();
shouldBeNull("indexedDB.open('db')");
finishJSTest();
Modified: trunk/LayoutTests/storage/websql/private-browsing-noread-nowrite.html (249541 => 249542)
--- trunk/LayoutTests/storage/websql/private-browsing-noread-nowrite.html 2019-09-05 21:01:23 UTC (rev 249541)
+++ trunk/LayoutTests/storage/websql/private-browsing-noread-nowrite.html 2019-09-05 21:12:05 UTC (rev 249542)
@@ -68,7 +68,7 @@
completed = 0;
if (window.testRunner)
- testRunner.setPrivateBrowsingEnabled(true);
+ testRunner.setPrivateBrowsingEnabled_DEPRECATED(true);
for (i in privateBrowsingStatements)
theTransaction.executeSql(privateBrowsingStatements[i], [], privateBrowsingSuccessFunction, privateBrowsingErrorFunction);
Modified: trunk/LayoutTests/storage/websql/private-browsing-open-disabled.html (249541 => 249542)
--- trunk/LayoutTests/storage/websql/private-browsing-open-disabled.html 2019-09-05 21:01:23 UTC (rev 249541)
+++ trunk/LayoutTests/storage/websql/private-browsing-open-disabled.html 2019-09-05 21:12:05 UTC (rev 249542)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ useEphemeralSession=true ] -->
<body>
<div id="logger"></div>
<script>
@@ -5,7 +6,6 @@
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
- testRunner.setPrivateBrowsingEnabled(true);
}
var logger = document.getElementById("logger");
Modified: trunk/Tools/ChangeLog (249541 => 249542)
--- trunk/Tools/ChangeLog 2019-09-05 21:01:23 UTC (rev 249541)
+++ trunk/Tools/ChangeLog 2019-09-05 21:12:05 UTC (rev 249542)
@@ -1,3 +1,46 @@
+2019-09-05 Chris Dumez <cdu...@apple.com>
+
+ [WK2] Add proper layout test support for ephemeral sessions
+ https://bugs.webkit.org/show_bug.cgi?id=201475
+
+ Reviewed by Antti Koivisto.
+
+ Add proper layout test support for ephemeral sessions via:
+ <!-- webkit-test-runner [ useEphemeralSession=true ] -->
+
+ This actually creates a new WebView using an ephemeral data store to load the test which
+ is *true* private browsing.
+
+ testRunner.setPrivateBrowsingEnabled() merely overrides the Page's sessionID in the WebContent
+ process, which is a hack and does not truly enable private browsing because the UIProcess and
+ the NetworkProcess are not properly updated on WK2. This patch renames testRunner.setPrivateBrowsingEnabled()
+ to testRunner.setPrivateBrowsingEnabled_DEPRECATED() to discourage its use since I am try to
+ get rid of it.
+
+ Note that WK2 does not support using a WebContent process for different sessions / data stores.
+ Each WebContent process has a single associated data store and testRunner.setPrivateBrowsingEnabled()
+ is currently the only exception to that. This leads to additional complexity in our code base (e.g. in ITP),
+ simply to support testRunner.setPrivateBrowsingEnabled().
+
+ * DumpRenderTree/TestOptions.cpp:
+ (TestOptions::TestOptions):
+ * DumpRenderTree/TestOptions.h:
+ * DumpRenderTree/TestRunner.cpp:
+ (TestRunner::staticFunctions):
+ * DumpRenderTree/mac/DumpRenderTree.mm:
+ (setWebPreferencesForTestOptions):
+ * WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
+ * WebKitTestRunner/InjectedBundle/TestRunner.cpp:
+ (WTR::TestRunner::setPrivateBrowsingEnabled_DEPRECATED):
+ * WebKitTestRunner/InjectedBundle/TestRunner.h:
+ * WebKitTestRunner/TestController.cpp:
+ (WTR::TestController::generatePageConfiguration):
+ (WTR::updateTestOptionsFromTestHeader):
+ * WebKitTestRunner/TestOptions.h:
+ (WTR::TestOptions::hasSameInitializationOptions const):
+ * WebKitTestRunner/cocoa/TestControllerCocoa.mm:
+ (WTR::TestController::platformCreateWebView):
+
2019-09-05 Ryosuke Niwa <rn...@webkit.org>
REGRESSION (iOS 13): Bulleted list copied from Notes to Mail results in Times New Roman
Modified: trunk/Tools/DumpRenderTree/TestOptions.cpp (249541 => 249542)
--- trunk/Tools/DumpRenderTree/TestOptions.cpp 2019-09-05 21:01:23 UTC (rev 249541)
+++ trunk/Tools/DumpRenderTree/TestOptions.cpp 2019-09-05 21:12:05 UTC (rev 249542)
@@ -79,6 +79,8 @@
useAcceleratedDrawing = parseBooleanTestHeaderValue(value);
else if (key == "enableIntersectionObserver")
enableIntersectionObserver = parseBooleanTestHeaderValue(value);
+ else if (key == "useEphemeralSession")
+ useEphemeralSession = parseBooleanTestHeaderValue(value);
else if (key == "enableMenuItemElement")
enableMenuItemElement = parseBooleanTestHeaderValue(value);
else if (key == "enableKeygenElement")
Modified: trunk/Tools/DumpRenderTree/TestOptions.h (249541 => 249542)
--- trunk/Tools/DumpRenderTree/TestOptions.h 2019-09-05 21:01:23 UTC (rev 249541)
+++ trunk/Tools/DumpRenderTree/TestOptions.h 2019-09-05 21:12:05 UTC (rev 249542)
@@ -32,6 +32,7 @@
bool enableWebAnimationsCSSIntegration { true };
bool useAcceleratedDrawing { false };
bool enableIntersectionObserver { false };
+ bool useEphemeralSession { false };
bool enableMenuItemElement { false };
bool enableKeygenElement { false };
bool enableModernMediaControls { true };
Modified: trunk/Tools/DumpRenderTree/TestRunner.cpp (249541 => 249542)
--- trunk/Tools/DumpRenderTree/TestRunner.cpp 2019-09-05 21:01:23 UTC (rev 249541)
+++ trunk/Tools/DumpRenderTree/TestRunner.cpp 2019-09-05 21:12:05 UTC (rev 249542)
@@ -2219,7 +2219,7 @@
{ "setPopupBlockingEnabled", setPopupBlockingEnabledCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "setPluginsEnabled", setPluginsEnabledCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "setPrinting", setPrintingCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
- { "setPrivateBrowsingEnabled", setPrivateBrowsingEnabledCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "setPrivateBrowsingEnabled_DEPRECATED", setPrivateBrowsingEnabledCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "setSerializeHTTPLoads", setSerializeHTTPLoadsCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "setSpatialNavigationEnabled", setSpatialNavigationEnabledCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "setStopProvisionalFrameLoads", setStopProvisionalFrameLoadsCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
Modified: trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm (249541 => 249542)
--- trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm 2019-09-05 21:01:23 UTC (rev 249541)
+++ trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm 2019-09-05 21:12:05 UTC (rev 249542)
@@ -1028,6 +1028,7 @@
preferences.resizeObserverEnabled = options.enableResizeObserver;
preferences.coreMathMLEnabled = options.enableCoreMathML;
preferences.lazyImageLoadingEnabled = options.enableLazyImageLoading;
+ preferences.privateBrowsingEnabled = options.useEphemeralSession;
}
// Called once on DumpRenderTree startup.
Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl (249541 => 249542)
--- trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl 2019-09-05 21:01:23 UTC (rev 249541)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl 2019-09-05 21:12:05 UTC (rev 249542)
@@ -85,7 +85,6 @@
void setNeedsStorageAccessFromFileURLsQuirk(boolean value);
void setPluginsEnabled(boolean value);
void setJavaScriptCanAccessClipboard(boolean value);
- void setPrivateBrowsingEnabled(boolean value);
void setPopupBlockingEnabled(boolean value);
void setAuthorAndUserStylesEnabled(boolean value);
void setCustomPolicyDelegate(boolean enabled, boolean permissive);
@@ -105,6 +104,9 @@
void setNavigationGesturesEnabled(boolean value);
void setIgnoresViewportScaleLimits(boolean value);
void setShouldDownloadUndisplayableMIMETypes(boolean value);
+
+ // DEPRECATED: Use <!-- webkit-test-runner [ useEphemeralSession=true ] --> instead.
+ void setPrivateBrowsingEnabled_DEPRECATED(boolean value);
// Special DOM functions.
void clearBackForwardList();
Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp (249541 => 249542)
--- trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp 2019-09-05 21:01:23 UTC (rev 249541)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp 2019-09-05 21:12:05 UTC (rev 249542)
@@ -531,7 +531,7 @@
WKBundleSetJavaScriptCanAccessClipboard(injectedBundle.bundle(), injectedBundle.pageGroup(), enabled);
}
-void TestRunner::setPrivateBrowsingEnabled(bool enabled)
+void TestRunner::setPrivateBrowsingEnabled_DEPRECATED(bool enabled)
{
auto& injectedBundle = InjectedBundle::singleton();
WKBundleSetPrivateBrowsingEnabled(injectedBundle.bundle(), injectedBundle.pageGroup(), enabled);
Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h (249541 => 249542)
--- trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h 2019-09-05 21:01:23 UTC (rev 249541)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h 2019-09-05 21:12:05 UTC (rev 249542)
@@ -112,7 +112,7 @@
void setNeedsStorageAccessFromFileURLsQuirk(bool);
void setPluginsEnabled(bool);
void setJavaScriptCanAccessClipboard(bool);
- void setPrivateBrowsingEnabled(bool);
+ void setPrivateBrowsingEnabled_DEPRECATED(bool);
void setPopupBlockingEnabled(bool);
void setAuthorAndUserStylesEnabled(bool);
void setCustomPolicyDelegate(bool enabled, bool permissive = false);
Modified: trunk/Tools/WebKitTestRunner/TestController.cpp (249541 => 249542)
--- trunk/Tools/WebKitTestRunner/TestController.cpp 2019-09-05 21:01:23 UTC (rev 249541)
+++ trunk/Tools/WebKitTestRunner/TestController.cpp 2019-09-05 21:12:05 UTC (rev 249542)
@@ -584,6 +584,11 @@
auto pageConfiguration = adoptWK(WKPageConfigurationCreate());
WKPageConfigurationSetContext(pageConfiguration.get(), m_context.get());
WKPageConfigurationSetPageGroup(pageConfiguration.get(), m_pageGroup.get());
+
+ if (options.useEphemeralSession) {
+ auto ephemeralDataStore = adoptWK(WKWebsiteDataStoreCreateNonPersistentDataStore());
+ WKPageConfigurationSetWebsiteDataStore(pageConfiguration.get(), ephemeralDataStore.get());
+ }
m_userContentController = adoptWK(WKUserContentControllerCreate());
WKPageConfigurationSetUserContentController(pageConfiguration.get(), userContentController());
@@ -1338,6 +1343,8 @@
testOptions.enableAttachmentElement = parseBooleanTestHeaderValue(value);
else if (key == "enableIntersectionObserver")
testOptions.enableIntersectionObserver = parseBooleanTestHeaderValue(value);
+ else if (key == "useEphemeralSession")
+ testOptions.useEphemeralSession = parseBooleanTestHeaderValue(value);
else if (key == "enableMenuItemElement")
testOptions.enableMenuItemElement = parseBooleanTestHeaderValue(value);
else if (key == "enableKeygenElement")
Modified: trunk/Tools/WebKitTestRunner/TestOptions.h (249541 => 249542)
--- trunk/Tools/WebKitTestRunner/TestOptions.h 2019-09-05 21:01:23 UTC (rev 249541)
+++ trunk/Tools/WebKitTestRunner/TestOptions.h 2019-09-05 21:12:05 UTC (rev 249542)
@@ -69,6 +69,7 @@
bool useCharacterSelectionGranularity { false };
bool enableAttachmentElement { false };
bool enableIntersectionObserver { false };
+ bool useEphemeralSession { false };
bool enableMenuItemElement { false };
bool enableKeygenElement { false };
bool enableModernMediaControls { true };
@@ -124,6 +125,7 @@
|| useCharacterSelectionGranularity != options.useCharacterSelectionGranularity
|| enableAttachmentElement != options.enableAttachmentElement
|| enableIntersectionObserver != options.enableIntersectionObserver
+ || useEphemeralSession != options.useEphemeralSession
|| enableMenuItemElement != options.enableMenuItemElement
|| enableKeygenElement != options.enableKeygenElement
|| enableModernMediaControls != options.enableModernMediaControls
Modified: trunk/Tools/WebKitTestRunner/cocoa/TestControllerCocoa.mm (249541 => 249542)
--- trunk/Tools/WebKitTestRunner/cocoa/TestControllerCocoa.mm 2019-09-05 21:01:23 UTC (rev 249541)
+++ trunk/Tools/WebKitTestRunner/cocoa/TestControllerCocoa.mm 2019-09-05 21:12:05 UTC (rev 249542)
@@ -160,6 +160,9 @@
if (options.enableUndoManagerAPI)
[copiedConfiguration _setUndoManagerAPIEnabled:YES];
+
+ if (options.useEphemeralSession)
+ [copiedConfiguration setWebsiteDataStore:[WKWebsiteDataStore nonPersistentDataStore]];
configureContentMode(copiedConfiguration.get(), options);