-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do not clear content filter when loading after serviceWorkerDidNotHandle #14561
Do not clear content filter when loading after serviceWorkerDidNotHandle #14561
Conversation
EWS run on previous version of this PR (hash b4a081a) |
b4a081a
to
cdc1e05
Compare
EWS run on previous version of this PR (hash cdc1e05) |
cdc1e05
to
7bca3da
Compare
EWS run on previous version of this PR (hash 7bca3da) |
7bca3da
to
668c2a6
Compare
EWS run on previous version of this PR (hash 668c2a6) |
"{" | ||
" frame = document.createElement('iframe');" | ||
" frame.src = \"/test.html\";" | ||
" frame.onload = function() { window.webkit.messageHandlers.sw.postMessage(frame.contentDocument.body.innerHTML); }" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could use log instead
"{" | ||
" frame = document.createElement('iframe');" | ||
" frame.src = \"/test.html\";" | ||
" frame.onload = function() { window.webkit.messageHandlers.sw.postMessage(frame.contentDocument.body.innerHTML); }" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could use log instead
|
||
@end | ||
|
||
static void loadAlternateTest(Decision decision, DecisionPoint decisionPoint) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it necessary to move this function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In order to make the test able to find all the functions where I initially placed it, yes. But I think I can just add the new test to the bottom to avoid this. I will make that change as not to pollute the blame too much.
[webView evaluateJavaScript:@"document.body.innerText" completionHandler:^(id result, NSError *error) { | ||
EXPECT_TRUE([result isKindOfClass:[NSString class]]); | ||
EXPECT_WK_STREQ(@"blocked", result); | ||
isDone = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know this is existing code but having EXPECT checks here makes the test a bit hard to read.
The test itself has no EXPECT checks, it feels like magic.
It could be easier to read if we would wait until done is true in the test, then do a EXPECT_TRUE... in the test itself.
|
||
TestWebKitAPI::HTTPServer server({ | ||
{ "/"_s, { mainForFetchTestBytes } }, | ||
{ "/sw.js"_s, { { { "Content-Type"_s, "application/javascript"_s } }, serviceWorkerJS } }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could add a "/test.html" entry for good measure.
668c2a6
to
aac5f01
Compare
EWS run on current version of this PR (hash aac5f01) |
https://bugs.webkit.org/show_bug.cgi?id=257569 rdar://109619110 Reviewed by Youenn Fablet. The content filter is cleared after serviceWorkerDidNotHandle is called, but another request can be made using the same NetworkResourceLoader, without a content filter. This patch fixes that by not clearing the filter. * Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::serviceWorkerDidNotHandle): * Tools/TestWebKitAPI/Tests/WebKitCocoa/ContentFiltering.mm: (TEST): Canonical link: https://commits.webkit.org/265022@main
aac5f01
to
36a507b
Compare
Committed 265022@main (36a507b): https://commits.webkit.org/265022@main Reviewed commits have been landed. Closing PR #14561 and removing active labels. |
36a507b
aac5f01