Changeset 229349 in webkit
- Timestamp:
- Mar 6, 2018 5:15:37 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r229348 r229349 1 2018-03-06 Youenn Fablet <youenn@apple.com> 2 3 didReceiveServerRedirectForProvisionalNavigation is not called in case of document redirection with service worker registration change 4 https://bugs.webkit.org/show_bug.cgi?id=183299 5 <rdar://problem/37547029> 6 7 Reviewed by Alex Christensen. 8 9 * http/wpt/service-workers/navigation-redirect-main-frame-worker.js: Added. 10 * http/wpt/service-workers/navigation-redirect-main-frame.https-expected.txt: Added. 11 * http/wpt/service-workers/navigation-redirect-main-frame.https.html: Added. 12 1 13 2018-03-06 Chris Dumez <cdumez@apple.com> 2 14 -
trunk/Source/WebCore/ChangeLog
r229347 r229349 1 2018-03-06 Youenn Fablet <youenn@apple.com> 2 3 didReceiveServerRedirectForProvisionalNavigation is not called in case of document redirection with service worker registration change 4 https://bugs.webkit.org/show_bug.cgi?id=183299 5 <rdar://problem/37547029> 6 7 Reviewed by Alex Christensen. 8 9 In case of redirection with service worker registration change, we cancel the load and create a new one. 10 This prevent ResourceLoader::willSendRequestInternal to call the didReceiveServerRedirectForProvisionalNavigation 11 callback. We thus explictly call this callback after restarting the load with the new service worker step. 12 We only call this callback if the main resource is there as we do not want to call it if it was blocked by content extension. 13 14 Test: http/wpt/service-workers/navigation-redirect-main-frame.https.html 15 16 * loader/DocumentLoader.cpp: 17 (WebCore::DocumentLoader::restartLoadingDueToServiceWorkerRegistrationChange): 18 1 19 2018-03-06 Basuke Suzuki <Basuke.Suzuki@sony.com> 2 20 -
trunk/Source/WebCore/loader/DocumentLoader.cpp
r229323 r229349 696 696 clearMainResource(); 697 697 698 ASSERT(!isCommitted()); 698 699 m_serviceWorkerRegistrationData = WTFMove(registrationData); 699 700 loadMainResource(WTFMove(request)); 701 702 if (m_mainResource) 703 frameLoader()->client().dispatchDidReceiveServerRedirectForProvisionalLoad(); 700 704 } 701 705 #endif -
trunk/Tools/ChangeLog
r229341 r229349 1 2018-03-06 Youenn Fablet <youenn@apple.com> 2 3 didReceiveServerRedirectForProvisionalNavigation is not called in case of document redirection with service worker registration change 4 https://bugs.webkit.org/show_bug.cgi?id=183299 5 <rdar://problem/37547029> 6 7 Reviewed by Alex Christensen. 8 9 Add support for checking whether this callback is called. 10 Used in the added layout test. 11 12 * WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl: 13 * WebKitTestRunner/InjectedBundle/TestRunner.cpp: 14 (WTR::TestRunner::didReceiveServerRedirectForProvisionalNavigation const): 15 (WTR::TestRunner::clearDidReceiveServerRedirectForProvisionalNavigation): 16 * WebKitTestRunner/InjectedBundle/TestRunner.h: 17 * WebKitTestRunner/TestController.cpp: 18 (WTR::TestController::createOtherPage): 19 (WTR::TestController::resetStateToConsistentValues): 20 (WTR::TestController::didReceiveServerRedirectForProvisionalNavigation): 21 * WebKitTestRunner/TestController.h: 22 (WTR::TestController::didReceiveServerRedirectForProvisionalNavigation const): 23 (WTR::TestController::clearDidReceiveServerRedirectForProvisionalNavigation): 24 * WebKitTestRunner/TestInvocation.cpp: 25 (WTR::TestInvocation::didReceiveSynchronousMessageFromInjectedBundle): 26 1 27 2018-03-06 Chris Dumez <cdumez@apple.com> 2 28 -
trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl
r229341 r229349 163 163 void setDefersLoading(boolean flag); 164 164 void setStopProvisionalFrameLoads(); 165 166 readonly attribute boolean didReceiveServerRedirectForProvisionalNavigation; 167 void clearDidReceiveServerRedirectForProvisionalNavigation(); 165 168 166 169 // Focus testing. -
trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp
r229209 r229349 621 621 } 622 622 623 bool TestRunner::didReceiveServerRedirectForProvisionalNavigation() const 624 { 625 WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("DidReceiveServerRedirectForProvisionalNavigation")); 626 WKTypeRef returnData = 0; 627 628 WKBundlePagePostSynchronousMessageForTesting(InjectedBundle::singleton().page()->page(), messageName.get(), 0, &returnData); 629 return WKBooleanGetValue(static_cast<WKBooleanRef>(returnData)); 630 } 631 632 void TestRunner::clearDidReceiveServerRedirectForProvisionalNavigation() 633 { 634 WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("ClearDidReceiveServerRedirectForProvisionalNavigation")); 635 WKBundlePagePostSynchronousMessageForTesting(InjectedBundle::singleton().page()->page(), messageName.get(), 0, nullptr); 636 } 637 623 638 void TestRunner::setPageVisibility(JSStringRef state) 624 639 { -
trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h
r229341 r229349 215 215 bool isPolicyDelegateEnabled() const { return m_policyDelegateEnabled; } 216 216 bool isPolicyDelegatePermissive() const { return m_policyDelegatePermissive; } 217 218 bool didReceiveServerRedirectForProvisionalNavigation() const; 219 void clearDidReceiveServerRedirectForProvisionalNavigation(); 217 220 218 221 bool waitToDump() const { return m_waitToDump; } -
trunk/Tools/WebKitTestRunner/TestController.cpp
r229177 r229349 305 305 decidePolicyForPluginLoad, 306 306 0, // didStartProvisionalNavigation 307 0, // didReceiveServerRedirectForProvisionalNavigation307 didReceiveServerRedirectForProvisionalNavigation, 308 308 0, // didFailProvisionalNavigation 309 309 0, // didCommitNavigation … … 579 579 decidePolicyForPluginLoad, 580 580 0, // didStartProvisionalNavigation 581 0, // didReceiveServerRedirectForProvisionalNavigation581 didReceiveServerRedirectForProvisionalNavigation, 582 582 0, // didFailProvisionalNavigation 583 583 didCommitNavigation, … … 864 864 865 865 statisticsResetToConsistentState(); 866 867 m_didReceiveServerRedirectForProvisionalNavigation = false; 866 868 867 869 // Reset main page back to about:blank … … 1622 1624 } 1623 1625 1626 void TestController::didReceiveServerRedirectForProvisionalNavigation(WKPageRef page, WKNavigationRef navigation, WKTypeRef userData, const void* clientInfo) 1627 { 1628 static_cast<TestController*>(const_cast<void*>(clientInfo))->didReceiveServerRedirectForProvisionalNavigation(page, navigation, userData); 1629 } 1630 1624 1631 bool TestController::canAuthenticateAgainstProtectionSpace(WKPageRef page, WKProtectionSpaceRef protectionSpace, const void* clientInfo) 1625 1632 { … … 1725 1732 { 1726 1733 mainWebView()->focus(); 1734 } 1735 1736 void TestController::didReceiveServerRedirectForProvisionalNavigation(WKPageRef page, WKNavigationRef navigation, WKTypeRef userData) 1737 { 1738 m_didReceiveServerRedirectForProvisionalNavigation = true; 1739 return; 1727 1740 } 1728 1741 -
trunk/Tools/WebKitTestRunner/TestController.h
r229177 r229349 209 209 uint64_t domCacheSize(WKStringRef origin); 210 210 211 bool didReceiveServerRedirectForProvisionalNavigation() const { return m_didReceiveServerRedirectForProvisionalNavigation; } 212 void clearDidReceiveServerRedirectForProvisionalNavigation() { m_didReceiveServerRedirectForProvisionalNavigation = false; } 213 211 214 private: 212 215 WKRetainPtr<WKPageConfigurationRef> generatePageConfiguration(WKContextConfigurationRef); … … 313 316 static void unavailablePluginButtonClicked(WKPageRef, WKPluginUnavailabilityReason, WKDictionaryRef, const void*); 314 317 318 static void didReceiveServerRedirectForProvisionalNavigation(WKPageRef, WKNavigationRef, WKTypeRef, const void*); 319 void didReceiveServerRedirectForProvisionalNavigation(WKPageRef, WKNavigationRef, WKTypeRef); 320 315 321 static bool canAuthenticateAgainstProtectionSpace(WKPageRef, WKProtectionSpaceRef, const void*); 316 322 bool canAuthenticateAgainstProtectionSpace(WKPageRef, WKProtectionSpaceRef); … … 419 425 bool m_shouldDecideResponsePolicyAfterDelay { false }; 420 426 427 bool m_didReceiveServerRedirectForProvisionalNavigation { false }; 428 421 429 WKRetainPtr<WKArrayRef> m_openPanelFileURLs; 422 430 -
trunk/Tools/WebKitTestRunner/TestInvocation.cpp
r229177 r229349 803 803 } 804 804 805 if (WKStringIsEqualToUTF8CString(messageName, "DidReceiveServerRedirectForProvisionalNavigation")) { 806 WKRetainPtr<WKBooleanRef> result(AdoptWK, WKBooleanCreate(TestController::singleton().didReceiveServerRedirectForProvisionalNavigation())); 807 return result; 808 } 809 810 if (WKStringIsEqualToUTF8CString(messageName, "ClearDidReceiveServerRedirectForProvisionalNavigation")) { 811 TestController::singleton().clearDidReceiveServerRedirectForProvisionalNavigation(); 812 return nullptr; 813 } 814 805 815 if (WKStringIsEqualToUTF8CString(messageName, "SecureEventInputIsEnabled")) { 806 816 #if PLATFORM(MAC) && !PLATFORM(IOS)
Note: See TracChangeset
for help on using the changeset viewer.