Unreviewed, rolling out r248942.
authorrussell_e@apple.com <russell_e@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 21 Aug 2019 18:47:59 +0000 (18:47 +0000)
committerrussell_e@apple.com <russell_e@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 21 Aug 2019 18:47:59 +0000 (18:47 +0000)
Causes multiple layout test crashes on MacOS Bots

Reverted changeset:

"Verify Prefetch and credential behavior"
https://bugs.webkit.org/show_bug.cgi?id=200000
https://trac.webkit.org/changeset/248942

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

LayoutTests/ChangeLog
LayoutTests/http/wpt/prefetch/link-prefetch-cross-origin-vary-cookie-expected.txt [deleted file]
LayoutTests/http/wpt/prefetch/link-prefetch-cross-origin-vary-cookie.html [deleted file]
LayoutTests/http/wpt/prefetch/resources/main-resource-cross-origin-set-cookie.py [deleted file]
LayoutTests/http/wpt/prefetch/resources/main-resource-cross-origin-vary-cookie.py [deleted file]
LayoutTests/http/wpt/prefetch/resources/navigate-cross-origin-vary-cookie.html [deleted file]
LayoutTests/platform/mac-wk1/TestExpectations
LayoutTests/platform/win/TestExpectations
Source/WebKit/ChangeLog
Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp
Source/WebKit/NetworkProcess/cache/PrefetchCache.cpp

index 974cc7a..c5dc95e 100644 (file)
@@ -1,3 +1,15 @@
+2019-08-21  Russell Epstein  <repstein@apple.com>
+
+        Unreviewed, rolling out r248942.
+
+        Causes multiple layout test crashes on MacOS Bots
+
+        Reverted changeset:
+
+        "Verify Prefetch and credential behavior"
+        https://bugs.webkit.org/show_bug.cgi?id=200000
+        https://trac.webkit.org/changeset/248942
+
 2019-08-21  Devin Rousso  <drousso@apple.com>
 
         Web Inspector: Page: re-add enable/disable after r248454
diff --git a/LayoutTests/http/wpt/prefetch/link-prefetch-cross-origin-vary-cookie-expected.txt b/LayoutTests/http/wpt/prefetch/link-prefetch-cross-origin-vary-cookie-expected.txt
deleted file mode 100644 (file)
index 8992672..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-
-PASS Verify that navigating to a prefetched main resource that sets Vary: Cookie does send cookies. 
-
diff --git a/LayoutTests/http/wpt/prefetch/link-prefetch-cross-origin-vary-cookie.html b/LayoutTests/http/wpt/prefetch/link-prefetch-cross-origin-vary-cookie.html
deleted file mode 100644 (file)
index 4e5006f..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-<!DOCTYPE html>
-<meta charset="utf-8">
-<script src="/resources/testharness.js"></script>
-<script src="/resources/testharnessreport.js"></script>
-<script>
-
-const wait_for_message = () => {
-  return new Promise((resolve, reject) => {
-    window.addEventListener('message', e => {
-      resolve(e);
-    }, { once: true });
-  });
-};
-
-promise_test(async function(t) {
-  let url_from = "resources/navigate-cross-origin-vary-cookie.html";
-  var w = window.open(url_from);
-  let message = await wait_for_message();
-  assert_equals(message.data, 'foo=bar');
-  w.close();
-}, 'Verify that navigating to a prefetched main resource that sets Vary: Cookie does send cookies.');
-</script>
diff --git a/LayoutTests/http/wpt/prefetch/resources/main-resource-cross-origin-set-cookie.py b/LayoutTests/http/wpt/prefetch/resources/main-resource-cross-origin-set-cookie.py
deleted file mode 100644 (file)
index 7f52448..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-def main(request, response):
-    headers = [("Content-Type", "text/html"), ("Set-Cookie", "foo=bar")]
-
-    response.headers.set("Access-Control-Allow-Origin", "http://localhost:8800")
-    response.headers.set("Access-Control-Allow-Credentials", "true")
-
-    return headers, ""
diff --git a/LayoutTests/http/wpt/prefetch/resources/main-resource-cross-origin-vary-cookie.py b/LayoutTests/http/wpt/prefetch/resources/main-resource-cross-origin-vary-cookie.py
deleted file mode 100644 (file)
index f523019..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-def main(request, response):
-    headers = [("Content-Type", "text/html"), ("Vary", "Cookie")]
-
-    document = """
-<!DOCTYPE html>
-<script>
-  function test() {
-    var result = '%(cookie)s';
-    window.opener.postMessage(result, '*');
-  }
-</script>
-<body onload="test()">
-"""
-
-    return headers, document % {'cookie': request.headers.get("Cookie", "") }
diff --git a/LayoutTests/http/wpt/prefetch/resources/navigate-cross-origin-vary-cookie.html b/LayoutTests/http/wpt/prefetch/resources/navigate-cross-origin-vary-cookie.html
deleted file mode 100644 (file)
index 1db7fdf..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-<!DOCTYPE html>
-<meta charset="utf-8">
-<script src="/common/get-host-info.sub.js"></script>
-<body onload="test()">
-<script>
-  if (window.testRunner)
-    testRunner.setAlwaysAcceptCookies(true);
-
-  async function test() {
-    var link = document.createElement("link");
-    link.rel = "prefetch";
-    link.href = get_host_info().HTTP_REMOTE_ORIGIN + "/WebKit/prefetch/resources/main-resource-cross-origin-vary-cookie.py";
-    document.body.appendChild(link);
-
-    await fetch(get_host_info().HTTP_REMOTE_ORIGIN + "/WebKit/prefetch/resources/main-resource-cross-origin-set-cookie.py", { "credentials": "include" });
-
-    window.location = get_host_info().HTTP_REMOTE_ORIGIN + "/WebKit/prefetch/resources/main-resource-cross-origin-vary-cookie.py";
-  }
-</script>
-</body>
index 83ad8f5..18d068a 100644 (file)
@@ -736,8 +736,11 @@ webkit.org/b/196915 [ Debug ] inspector/timeline/timeline-recording.html [ Pass
 webkit.org/b/195623 http/tests/cache/link-prefetch-main-resource.html [ Skip ]
 webkit.org/b/195623 http/tests/cache/link-prefetch-main-resource-iframe.html [ Skip ]
 
-# prefetch not supported in WK1
-http/wpt/prefetch [ Skip ]
+webkit.org/b/197371 http/wpt/prefetch/link-prefetch-main-resource-redirect.html [ Skip ]
+webkit.org/b/199499 http/wpt/prefetch/link-prefetch-skip-disk-cache.html [ Skip ]
+
+webkit.org/b/199632 http/wpt/prefetch/beforeload.html [ Skip ]
+webkit.org/b/199632 http/wpt/prefetch/beforeload-dynamic.html [ Skip ]
 
 webkit.org/b/198177 pointerevents/mouse/compatibility-mouse-events-prevention-mouse-pressed.html [ Skip ]
 
index ddbe1ab..33bf6b7 100644 (file)
@@ -4422,8 +4422,11 @@ webkit.org/b/197310 fast/harness/render-tree-as-text-options.html [ Failure ]
 webkit.org/b/195623 http/tests/cache/link-prefetch-main-resource.html [ Skip ]
 webkit.org/b/195623 http/tests/cache/link-prefetch-main-resource-iframe.html [ Skip ]
 
-# prefetch not supported in WK1
-http/wpt/prefetch [ Skip ]
+webkit.org/b/197371 http/wpt/prefetch/link-prefetch-main-resource-redirect.html [ Skip ]
+webkit.org/b/199499 http/wpt/prefetch/link-prefetch-skip-disk-cache.html [ Skip ]
+
+webkit.org/b/199632 http/wpt/prefetch/beforeload.html [ Skip ]
+webkit.org/b/199632 http/wpt/prefetch/beforeload-dynamic.html [ Skip ]
 
 webkit.org/b/198112 http/tests/security/showModalDialog-sync-cross-origin-page-load2.html [ Skip ]
 
index 7c2b665..becc77b 100644 (file)
@@ -1,3 +1,15 @@
+2019-08-21  Russell Epstein  <repstein@apple.com>
+
+        Unreviewed, rolling out r248942.
+
+        Causes multiple layout test crashes on MacOS Bots
+
+        Reverted changeset:
+
+        "Verify Prefetch and credential behavior"
+        https://bugs.webkit.org/show_bug.cgi?id=200000
+        https://trac.webkit.org/changeset/248942
+
 2019-08-21  Keith Rollin  <krollin@apple.com>
 
         Remove support for watchOS < 6.0
index 87791d1..aaec72e 100644 (file)
@@ -221,6 +221,7 @@ void NetworkResourceLoader::retrieveCacheEntry(const ResourceRequest& request)
         ASSERT(m_parameters.options.mode == FetchOptions::Mode::Navigate);
         if (auto* session = m_connection->networkProcess().networkSession(sessionID())) {
             if (auto entry = session->prefetchCache().take(request.url())) {
+                // FIXME: Deal with credentials (https://bugs.webkit.org/show_bug.cgi?id=200000)
                 if (!entry->redirectRequest.isNull()) {
                     auto cacheEntry = m_cache->makeRedirectEntry(request, entry->response, entry->redirectRequest);
                     retrieveCacheEntryInternal(WTFMove(cacheEntry), ResourceRequest { request });
@@ -499,13 +500,8 @@ void NetworkResourceLoader::didReceiveResponse(ResourceResponse&& receivedRespon
         return completionHandler(PolicyAction::Use);
     }
 
-    if (isCrossOriginPrefetch()) {
-        if (response.httpHeaderField(HTTPHeaderName::Vary).contains("Cookie")) {
-            abort();
-            return completionHandler(PolicyAction::Ignore);
-        }
+    if (isCrossOriginPrefetch())
         return completionHandler(PolicyAction::Use);
-    }
 
     // We wait to receive message NetworkResourceLoader::ContinueDidReceiveResponse before continuing a load for
     // a main resource because the embedding client must decide whether to allow the load.
index 2325a5e..7104d1f 100644 (file)
@@ -65,9 +65,7 @@ std::unique_ptr<PrefetchCache::Entry> PrefetchCache::take(const URL& url)
     m_sessionExpirationList.removeAllMatching([&url] (const auto& tuple) {
         return std::get<0>(tuple) == url;
     });
-    auto entry = resources->take(url);
-    ASSERT(!entry->response.httpHeaderField(WebCore::HTTPHeaderName::Vary).contains("Cookie"));
-    return entry;
+    return resources->take(url);
 }
 
 static const Seconds expirationTimeout { 5_s };