Stop using testRunner.setPrivateBrowsingEnabled_DEPRECATED() in http/tests/security...
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 13 Sep 2019 14:42:14 +0000 (14:42 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 13 Sep 2019 14:42:14 +0000 (14:42 +0000)
https://bugs.webkit.org/show_bug.cgi?id=201704

Reviewed by Youenn Fablet.

Stop using testRunner.setPrivateBrowsingEnabled_DEPRECATED() in http/tests/security/appcache-in-private-browsing.html
and use the new useEphemeralSession WKTR / DRT flag instead.

* http/tests/security/appcache-in-private-browsing-expected.txt:
* http/tests/security/appcache-in-private-browsing.html:
* http/tests/security/resources/frame-for-appcache-in-private-browsing.html:
* platform/mac-wk2/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@249833 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/http/tests/security/appcache-in-private-browsing-expected.txt
LayoutTests/http/tests/security/appcache-in-private-browsing.html
LayoutTests/http/tests/security/appcache-switching-private-browsing-expected.txt
LayoutTests/http/tests/security/resources/frame-for-appcache-in-private-browsing.html
LayoutTests/platform/wk2/TestExpectations

index 3966253..52e5ca3 100644 (file)
@@ -1,3 +1,18 @@
+2019-09-13  Chris Dumez  <cdumez@apple.com>
+
+        Stop using testRunner.setPrivateBrowsingEnabled_DEPRECATED() in http/tests/security/appcache-in-private-browsing.html
+        https://bugs.webkit.org/show_bug.cgi?id=201704
+
+        Reviewed by Youenn Fablet.
+
+        Stop using testRunner.setPrivateBrowsingEnabled_DEPRECATED() in http/tests/security/appcache-in-private-browsing.html
+        and use the new useEphemeralSession WKTR / DRT flag instead.
+
+        * http/tests/security/appcache-in-private-browsing-expected.txt:
+        * http/tests/security/appcache-in-private-browsing.html:
+        * http/tests/security/resources/frame-for-appcache-in-private-browsing.html:
+        * platform/mac-wk2/TestExpectations:
+
 2019-09-13  Joseph Pecoraro  <pecoraro@apple.com>
 
         Web Inspector: Formatter: Pretty Print HTML resources (including inline <script>/<style>)
index 0032921..1699715 100644 (file)
@@ -1,5 +1,3 @@
-CONSOLE MESSAGE: line 1: ApplicationCache is deprecated. Please use ServiceWorkers instead.
-CONSOLE MESSAGE: line 31: Application cache not loaded
 This test passes if the application cache does not load while in private browsing
 
 
@@ -7,4 +5,5 @@ This test passes if the application cache does not load while in private browsin
 --------
 Frame: '<!--frame1-->'
 --------
+Application cache not loaded
 
index 0b683e2..4dade3a 100644 (file)
@@ -1,3 +1,4 @@
+<!-- webkit-test-runner [ useEphemeralSession=true ] -->
 <html>
 <head>
 <script>
@@ -7,21 +8,14 @@ if (window.testRunner) {
        testRunner.waitUntilDone();
 }
 
-function finishTest(frame) {
+function finishTest() {
        if (window.testRunner)
                testRunner.notifyDone();
 }
-
-function enterPrivateBrowsing(frame) {
-       if (window.testRunner)
-               testRunner.setPrivateBrowsingEnabled_DEPRECATED(true);
-       frame.onload = finishTest;
-       frame.contentWindow.location.reload();
-}
 </script>
 </head>
 <body>
 <p>This test passes if the application cache does not load while in private browsing</p>
-<iframe src="resources/frame-for-appcache-in-private-browsing.html" onload="enterPrivateBrowsing(this)"></iframe>
+<iframe src="resources/frame-for-appcache-in-private-browsing.html" onload="finishTest()"></iframe>
 </body>
 </html>
index e39d94d..ed38bc7 100644 (file)
@@ -8,4 +8,6 @@ This test passes if the application cache does not load while in private browsin
 --------
 Frame: '<!--frame1-->'
 --------
+Application cache loaded
+Application cache not loaded
 
index 7bcefa1..c88da28 100644 (file)
@@ -1,34 +1,40 @@
 <html manifest="manifest-for-appcache.manifest">
 <head>
 <script>
+function log(msg)
+{
+    let c = document.getElementById("console");
+    c.innerHTML = c.innerHTML + msg + "<br>";
+}
+
 function updateAppCache(callback) {
        appCacheCallback = callback;
        window.applicationCache.update();
 }
 
 window.applicationCache.onnoupdate = function(e) {
-       console.log("Application cache loaded");
+       log("Application cache loaded");
        if (window.appCacheCallback) {
                appCacheCallback(true);
        }
 }
 
 window.applicationCache.oncached = function(e) {
-       console.log("Application cache loaded");
+       log("Application cache loaded");
        if (window.appCacheCallback) {
                appCacheCallback(true);
        }
 }
 
 window.applicationCache.onupdateready = function(e) {
-       console.log("Application cache loaded");
+       log("Application cache loaded");
        if (window.appCacheCallback) {
                appCacheCallback(true);
        }
 }
 
 window.applicationCache.onerror = function(e) {
-       console.log("Application cache not loaded");
+       log("Application cache not loaded");
        if (window.appCacheCallback) {
                appCacheCallback(false);
        }
@@ -36,6 +42,7 @@ window.applicationCache.onerror = function(e) {
 </script>
 </head>
 <body>
+<div id="console"></div>
 <img src="abe.png">
 </body>
 </html>
index 0ea4294..384afb5 100644 (file)
@@ -90,7 +90,6 @@ platform/mac/fast/text/justified-text-rect.html
 
 # https://bugs.webkit.org/show_bug.cgi?id=115274
 # testRunner.setPrivateBrowsingEnabled_DEPRECATED() doesn't work with NetworkProcess and is WebKitLegacy only.
-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-xslt.xml [ Skip ]