RESOLVED FIXED 183345
fast/loader/redirect-to-invalid-url-using-meta-refresh-disallowed.html fails with async policy delegates
https://bugs.webkit.org/show_bug.cgi?id=183345
Summary fast/loader/redirect-to-invalid-url-using-meta-refresh-disallowed.html fails ...
Ali Juma
Reported 2018-03-05 14:21:05 PST
This fails for two reasons: 1) With async policy delegates, FrameLoader::m_quickRedirectComing gets cleared before the policy response is received, so continueLoadAfterNavigationPolicy doesn't call clientRedirectCancelledOrFinished, which means WebFrameLoaderClient::dispatchDidCancelClientRedirect never gets called. 2) The test doesn't wait long enough to receive an async policy response; it just uses setTimeout(_, 0).
Attachments
WIP (6.31 KB, patch)
2018-03-05 14:26 PST, Ali Juma
ews-watchlist: commit-queue-
WIP patch (chris) (19.59 KB, patch)
2018-03-05 15:38 PST, Chris Dumez
ews-watchlist: commit-queue-
Archive of layout-test-results from ews100 for mac-sierra (2.37 MB, application/zip)
2018-03-05 15:38 PST, EWS Watchlist
no flags
Archive of layout-test-results from ews117 for mac-sierra (3.07 MB, application/zip)
2018-03-05 16:19 PST, EWS Watchlist
no flags
Archive of layout-test-results from ews104 for mac-sierra-wk2 (2.88 MB, application/zip)
2018-03-05 16:42 PST, EWS Watchlist
no flags
WIP patch (37.33 KB, patch)
2018-03-06 10:52 PST, Chris Dumez
no flags
WIP patch (39.64 KB, patch)
2018-03-06 10:58 PST, Chris Dumez
ews-watchlist: commit-queue-
Archive of layout-test-results from ews106 for mac-sierra-wk2 (2.61 MB, application/zip)
2018-03-06 11:50 PST, EWS Watchlist
no flags
WIP patch (39.66 KB, patch)
2018-03-06 12:03 PST, Chris Dumez
no flags
Patch (48.12 KB, patch)
2018-03-06 13:09 PST, Chris Dumez
no flags
Ali Juma
Comment 1 2018-03-05 14:26:31 PST
Ali Juma
Comment 2 2018-03-05 14:28:02 PST
Comment on attachment 335028 [details] WIP View in context: https://bugs.webkit.org/attachment.cgi?id=335028&action=review > LayoutTests/fast/loader/redirect-to-invalid-url-using-meta-refresh-disallowed-async-delegate.html:26 > +}, 250); Is there a better way than setTimeout to make the test wait for the async policy response?
Chris Dumez
Comment 3 2018-03-05 14:41:06 PST
I am away from my machine now but I do not think this is the right fix. If I remember correctly, the issue is that this flag gets set, then we call a method that used to be synchronous, then the flag gets reset. Now that the method is async, I fixed this by passing in a lambda. I will confirm when I get back to my computer that this is the same issue I was working on.
Chris Dumez
Comment 4 2018-03-05 15:37:16 PST
(In reply to Chris Dumez from comment #3) > I am away from my machine now but I do not think this is the right fix. If I > remember correctly, the issue is that this flag gets set, then we call a > method that used to be synchronous, then the flag gets reset. Now that the > method is async, I fixed this by passing in a lambda. I will confirm when I > get back to my computer that this is the same issue I was working on. I was referring to this call site: bool isRedirect = m_quickRedirectComing; loadWithNavigationAction(request, action, lockHistory, newLoadType, formState, allowNavigationToInvalidURL); if (isRedirect) { m_quickRedirectComing = false; loadWithNavigationAction() now gets the policy decision asynchronously, and thus relies on m_quickRedirectComing asynchronously. This is an issue here because this call site sets it back to false synchronously.
Chris Dumez
Comment 5 2018-03-05 15:38:23 PST
Created attachment 335038 [details] WIP patch (chris) This is the work in progress patch I had locally. I had not uploaded it yet because the test was still failing after the change. Do you agree with my analysis?
EWS Watchlist
Comment 6 2018-03-05 15:38:38 PST
Comment on attachment 335028 [details] WIP Attachment 335028 [details] did not pass mac-ews (mac): Output: http://webkit-queues.webkit.org/results/6816984 New failing tests: fast/loader/redirect-to-invalid-url-using-meta-refresh-disallowed-async-delegate.html
EWS Watchlist
Comment 7 2018-03-05 15:38:39 PST
Created attachment 335040 [details] Archive of layout-test-results from ews100 for mac-sierra The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: ews100 Port: mac-sierra Platform: Mac OS X 10.12.6
Chris Dumez
Comment 8 2018-03-05 16:07:05 PST
Comment on attachment 335028 [details] WIP View in context: https://bugs.webkit.org/attachment.cgi?id=335028&action=review >> LayoutTests/fast/loader/redirect-to-invalid-url-using-meta-refresh-disallowed-async-delegate.html:26 >> +}, 250); > > Is there a better way than setTimeout to make the test wait for the async policy response? Unfortunately we have to find a better way (not sure how yet). Relying on a timer like this will almost certainly cause the test to be flaky on our bots.
Ali Juma
Comment 9 2018-03-05 16:16:52 PST
(In reply to Chris Dumez from comment #5) > Created attachment 335038 [details] > WIP patch (chris) > > This is the work in progress patch I had locally. I had not uploaded it yet > because the test was still failing after the change. > > Do you agree with my analysis? Yes, your analysis makes sense to me.
Chris Dumez
Comment 10 2018-03-05 16:18:18 PST
(In reply to Ali Juma from comment #9) > (In reply to Chris Dumez from comment #5) > > Created attachment 335038 [details] > > WIP patch (chris) > > > > This is the work in progress patch I had locally. I had not uploaded it yet > > because the test was still failing after the change. > > > > Do you agree with my analysis? > > Yes, your analysis makes sense to me. Ok, then we just need to find a reliable way to update tests. Unfortunately, there are several tests that are missing such "didCancelClientRedirectForFrame" line.
EWS Watchlist
Comment 11 2018-03-05 16:19:35 PST
Comment on attachment 335028 [details] WIP Attachment 335028 [details] did not pass mac-debug-ews (mac): Output: http://webkit-queues.webkit.org/results/6817026 New failing tests: fast/loader/redirect-to-invalid-url-using-meta-refresh-disallowed-async-delegate.html imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location-protocol-setter-non-broken.html
EWS Watchlist
Comment 12 2018-03-05 16:19:45 PST
Created attachment 335046 [details] Archive of layout-test-results from ews117 for mac-sierra The attached test failures were seen while running run-webkit-tests on the mac-debug-ews. Bot: ews117 Port: mac-sierra Platform: Mac OS X 10.12.6
Ali Juma
Comment 13 2018-03-05 16:20:51 PST
(In reply to Chris Dumez from comment #10) > (In reply to Ali Juma from comment #9) > > (In reply to Chris Dumez from comment #5) > > > Created attachment 335038 [details] > > > WIP patch (chris) > > > > > > This is the work in progress patch I had locally. I had not uploaded it yet > > > because the test was still failing after the change. > > > > > > Do you agree with my analysis? > > > > Yes, your analysis makes sense to me. > > Ok, then we just need to find a reliable way to update tests. Unfortunately, > there are several tests that are missing such > "didCancelClientRedirectForFrame" line. Maybe we need to add something like a TestRunner API that takes a callback and calls it after an IPC round-trip to/from the UIProcess?
Chris Dumez
Comment 14 2018-03-05 16:27:47 PST
(In reply to Ali Juma from comment #13) > (In reply to Chris Dumez from comment #10) > > (In reply to Ali Juma from comment #9) > > > (In reply to Chris Dumez from comment #5) > > > > Created attachment 335038 [details] > > > > WIP patch (chris) > > > > > > > > This is the work in progress patch I had locally. I had not uploaded it yet > > > > because the test was still failing after the change. > > > > > > > > Do you agree with my analysis? > > > > > > Yes, your analysis makes sense to me. > > > > Ok, then we just need to find a reliable way to update tests. Unfortunately, > > there are several tests that are missing such > > "didCancelClientRedirectForFrame" line. > > Maybe we need to add something like a TestRunner API that takes a callback > and calls it after an IPC round-trip to/from the UIProcess? Do you mind if I take this over? We don't even need to involve the UIProcess since the line in question is logged in the WebProcess via InjectedBundle.
EWS Watchlist
Comment 15 2018-03-05 16:42:42 PST
Comment on attachment 335038 [details] WIP patch (chris) Attachment 335038 [details] did not pass mac-wk2-ews (mac-wk2): Output: http://webkit-queues.webkit.org/results/6817569 New failing tests: imported/w3c/web-platform-tests/html/browsers/windows/noreferrer-window-name.html
EWS Watchlist
Comment 16 2018-03-05 16:42:43 PST
Created attachment 335051 [details] Archive of layout-test-results from ews104 for mac-sierra-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: ews104 Port: mac-sierra-wk2 Platform: Mac OS X 10.12.6
Ali Juma
Comment 17 2018-03-05 16:51:05 PST
(In reply to Chris Dumez from comment #14) > (In reply to Ali Juma from comment #13) > > (In reply to Chris Dumez from comment #10) > > > (In reply to Ali Juma from comment #9) > > > > (In reply to Chris Dumez from comment #5) > > > > > Created attachment 335038 [details] > > > > > WIP patch (chris) > > > > > > > > > > This is the work in progress patch I had locally. I had not uploaded it yet > > > > > because the test was still failing after the change. > > > > > > > > > > Do you agree with my analysis? > > > > > > > > Yes, your analysis makes sense to me. > > > > > > Ok, then we just need to find a reliable way to update tests. Unfortunately, > > > there are several tests that are missing such > > > "didCancelClientRedirectForFrame" line. > > > > Maybe we need to add something like a TestRunner API that takes a callback > > and calls it after an IPC round-trip to/from the UIProcess? > > Do you mind if I take this over? We don't even need to involve the UIProcess > since the line in question is logged in the WebProcess via InjectedBundle. Sure, go ahead :)
Chris Dumez
Comment 18 2018-03-06 09:23:51 PST
Tests failing in a similar way: fast/loader/redirect-to-invalid-url-using-javascript-disallowed.html fast/loader/redirect-to-invalid-url-using-meta-refresh-disallowed.html fast/loader/window-open-to-invalid-url-disallowed.html
Chris Dumez
Comment 19 2018-03-06 10:52:44 PST
Created attachment 335115 [details] WIP patch
Chris Dumez
Comment 20 2018-03-06 10:58:26 PST
Created attachment 335116 [details] WIP patch
EWS Watchlist
Comment 21 2018-03-06 11:50:19 PST
Comment on attachment 335116 [details] WIP patch Attachment 335116 [details] did not pass mac-wk2-ews (mac-wk2): Output: http://webkit-queues.webkit.org/results/6829103 New failing tests: imported/w3c/web-platform-tests/html/browsers/windows/noreferrer-window-name.html
EWS Watchlist
Comment 22 2018-03-06 11:50:20 PST
Created attachment 335120 [details] Archive of layout-test-results from ews106 for mac-sierra-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: ews106 Port: mac-sierra-wk2 Platform: Mac OS X 10.12.6
Chris Dumez
Comment 23 2018-03-06 12:03:49 PST
Created attachment 335125 [details] WIP patch
Chris Dumez
Comment 24 2018-03-06 13:09:52 PST
Chris Dumez
Comment 25 2018-03-06 14:01:32 PST
Comment on attachment 335130 [details] Patch Clearing flags on attachment: 335130 Committed r229341: <https://trac.webkit.org/changeset/229341>
Chris Dumez
Comment 26 2018-03-06 14:01:35 PST
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 27 2018-03-06 14:02:33 PST
Note You need to log in before you can comment on or make changes to this bug.