Title: [205481] trunk
Revision
205481
Author
[email protected]
Date
2016-09-06 09:03:39 -0700 (Tue, 06 Sep 2016)

Log Message

http/tests/security/contentSecurityPolicy/worker-csp-blocks-xhr-redirect-cross-origin.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=161627

Patch by Youenn Fablet <[email protected]> on 2016-09-06
Reviewed by Darin Adler.

Source/WebCore:

Covered by changed expectation.

* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::redirectReceived): Clearing the resource in lieu of clearing the request. This will stop the resource load.
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::didReceiveResponse): Adding an ASSERT to ensure that no valid redirect responses is mistakenly processed here.

LayoutTests:

* TestExpectations: Removing flakiness expectation.

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (205480 => 205481)


--- trunk/LayoutTests/ChangeLog	2016-09-06 16:01:54 UTC (rev 205480)
+++ trunk/LayoutTests/ChangeLog	2016-09-06 16:03:39 UTC (rev 205481)
@@ -1,5 +1,14 @@
 2016-09-06  Youenn Fablet  <[email protected]>
 
+        http/tests/security/contentSecurityPolicy/worker-csp-blocks-xhr-redirect-cross-origin.html is flaky
+        https://bugs.webkit.org/show_bug.cgi?id=161627
+
+        Reviewed by Darin Adler.
+
+        * TestExpectations: Removing flakiness expectation.
+
+2016-09-06  Youenn Fablet  <[email protected]>
+
         Using tests-options.json to compute whether tests are slow
         https://bugs.webkit.org/show_bug.cgi?id=161626
 

Modified: trunk/LayoutTests/TestExpectations (205480 => 205481)


--- trunk/LayoutTests/TestExpectations	2016-09-06 16:01:54 UTC (rev 205480)
+++ trunk/LayoutTests/TestExpectations	2016-09-06 16:03:39 UTC (rev 205481)
@@ -781,8 +781,6 @@
 http/tests/security/contentSecurityPolicy/script-src-blocked-error-event.html [ Pass Failure ]
 webkit.org/b/158480 http/tests/websocket/tests/hybi/upgrade-simple-ws.html [ Skip ]
 
-webkit.org/b/161389 http/tests/security/contentSecurityPolicy/worker-csp-blocks-xhr-redirect-cross-origin.html [ Pass Failure  ]
-
 # These state object tests purposefully stress a resource limit, and take multiple seconds to run.
 loader/stateobjects/pushstate-size-iframe.html [ Slow ]
 loader/stateobjects/pushstate-size.html [ Slow ]

Modified: trunk/Source/WebCore/ChangeLog (205480 => 205481)


--- trunk/Source/WebCore/ChangeLog	2016-09-06 16:01:54 UTC (rev 205480)
+++ trunk/Source/WebCore/ChangeLog	2016-09-06 16:03:39 UTC (rev 205481)
@@ -1,3 +1,17 @@
+2016-09-06  Youenn Fablet  <[email protected]>
+
+        http/tests/security/contentSecurityPolicy/worker-csp-blocks-xhr-redirect-cross-origin.html is flaky
+        https://bugs.webkit.org/show_bug.cgi?id=161627
+
+        Reviewed by Darin Adler.
+
+        Covered by changed expectation.
+
+        * loader/DocumentThreadableLoader.cpp:
+        (WebCore::DocumentThreadableLoader::redirectReceived): Clearing the resource in lieu of clearing the request. This will stop the resource load.
+        * loader/SubresourceLoader.cpp:
+        (WebCore::SubresourceLoader::didReceiveResponse): Adding an ASSERT to ensure that no valid redirect responses is mistakenly processed here.
+
 2016-09-06  Zalan Bujtas  <[email protected]>
 
         ASSERTION FAILED: !currBox->needsLayout() in WebCore::RenderBlock::checkPositionedObjectsNeedLayout

Modified: trunk/Source/WebCore/loader/DocumentThreadableLoader.cpp (205480 => 205481)


--- trunk/Source/WebCore/loader/DocumentThreadableLoader.cpp	2016-09-06 16:01:54 UTC (rev 205480)
+++ trunk/Source/WebCore/loader/DocumentThreadableLoader.cpp	2016-09-06 16:03:39 UTC (rev 205481)
@@ -222,7 +222,7 @@
     Ref<DocumentThreadableLoader> protectedThis(*this);
     if (!isAllowedByContentSecurityPolicy(request.url(), !redirectResponse.isNull())) {
         reportContentSecurityPolicyError(*m_client, redirectResponse.url());
-        request = ResourceRequest();
+        clearResource();
         return;
     }
 

Modified: trunk/Source/WebCore/loader/SubresourceLoader.cpp (205480 => 205481)


--- trunk/Source/WebCore/loader/SubresourceLoader.cpp	2016-09-06 16:01:54 UTC (rev 205480)
+++ trunk/Source/WebCore/loader/SubresourceLoader.cpp	2016-09-06 16:03:39 UTC (rev 205481)
@@ -244,6 +244,9 @@
     ASSERT(!response.isNull());
     ASSERT(m_state == Initialized);
 
+    // We want redirect responses to be processed through willSendRequestInternal. The only exception is redirection with no Location headers.
+    ASSERT(response.httpStatusCode() < 300 || response.httpStatusCode() >= 400 || response.httpStatusCode() == 304 || !response.httpHeaderField(HTTPHeaderName::Location));
+
     // Reference the object in this method since the additional processing can do
     // anything including removing the last reference to this object; one example of this is 3266216.
     Ref<SubresourceLoader> protectedThis(*this);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to