Changeset 249675 in webkit
- Timestamp:
- Sep 9, 2019, 4:35:12 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 16 edited
- 1 moved
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/http/tests/adClickAttribution/conversion-disabled-in-ephemeral-session.html (modified) (2 diffs)
-
Source/WebKit/ChangeLog (modified) (1 diff)
-
Source/WebKit/UIProcess/API/C/WKFramePolicyListener.cpp (modified) (1 diff)
-
Source/WebKit/UIProcess/Cocoa/NavigationState.mm (modified) (1 diff)
-
Tools/ChangeLog (modified) (1 diff)
-
Tools/DumpRenderTree/DefaultPolicyDelegate.mm (moved) (moved from trunk/Tools/DumpRenderTree/DefaultPolicyDelegate.m ) (3 diffs)
-
Tools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj (modified) (4 diffs)
-
Tools/DumpRenderTree/TestRunner.cpp (modified) (3 diffs)
-
Tools/DumpRenderTree/TestRunner.h (modified) (2 diffs)
-
Tools/DumpRenderTree/mac/PolicyDelegate.mm (modified) (1 diff)
-
Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl (modified) (2 diffs)
-
Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp (modified) (1 diff)
-
Tools/WebKitTestRunner/InjectedBundle/TestRunner.h (modified) (1 diff)
-
Tools/WebKitTestRunner/TestController.cpp (modified) (2 diffs)
-
Tools/WebKitTestRunner/TestController.h (modified) (2 diffs)
-
Tools/WebKitTestRunner/TestInvocation.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r249672 r249675 1 2019-09-09 Chris Dumez <cdumez@apple.com> 2 3 Stop using testRunner.setPrivateBrowsingEnabled_DEPRECATED() in http/tests/adClickAttribution/conversion-disabled-in-ephemeral-session.html 4 https://bugs.webkit.org/show_bug.cgi?id=201596 5 6 Reviewed by Alex Christensen. 7 8 Update layout test to use testRunner.setShouldSwapToEphemeralSessionOnNextNavigation() & 9 testRunner.setShouldSwapToDefaultSessionOnNextNavigation() instead of the legacy 10 testRunner.setPrivateBrowsingEnabled_DEPRECATED(). The test needed some extra steps to 11 navigate whenever we switch session but it is a lot more realistic and is really switching 12 session on WebKit2. The testRunner.setPrivateBrowsingEnabled_DEPRECATED() was not truly 13 switching session, just making the document think it did. 14 15 * http/tests/adClickAttribution/conversion-disabled-in-ephemeral-session.html: 16 1 17 2019-09-09 Chris Dumez <cdumez@apple.com> 2 18 -
trunk/LayoutTests/http/tests/adClickAttribution/conversion-disabled-in-ephemeral-session.html
r249542 r249675 46 46 testRunner.dumpAdClickAttribution(); 47 47 document.body.removeChild(document.getElementById("targetLink")); 48 document.body.removeChild(document.getElementById("pixel"));49 48 50 49 appendIframe("http://127.0.0.1:8000/adClickAttribution/resources/getConversionData.php?timeout_ms=1000&nonce=" + nonce, function() { … … 56 55 if (window.testRunner) { 57 56 if (window.location.search === "?stepTwo") { 58 testRunner.setPrivateBrowsingEnabled_DEPRECATED(true); 57 testRunner.setShouldSwapToEphemeralSessionOnNextNavigation(true); 58 window.location = "http://localhost:8000/adClickAttribution/conversion-disabled-in-ephemeral-session.html?stepThree"; 59 } else if (window.location.search === "?stepThree") { 59 60 let imageElement = document.createElement("img"); 60 61 imageElement.src = "https://127.0.0.1:8443/adClickAttribution/resources/redirectToConversion.php?conversionData=12&nonce=" + nonce; 61 62 imageElement.id = "pixel"; 62 63 imageElement.onerror = function() { 63 appendConversionDataIframeAndFinish(); 64 testRunner.setShouldSwapToDefaultSessionOnNextNavigation(true); 65 window.location = "http://localhost:8000/adClickAttribution/conversion-disabled-in-ephemeral-session.html?stepFour"; 64 66 }; 65 67 document.body.appendChild(imageElement); 68 } else if (window.location.search === "?stepFour") { 69 appendConversionDataIframeAndFinish(); 66 70 } else { 67 71 document.cookie = "cookieSetAsFirstParty=1; path=/"; -
trunk/Source/WebKit/ChangeLog
r249671 r249675 1 2019-09-09 Chris Dumez <cdumez@apple.com> 2 3 Stop using testRunner.setPrivateBrowsingEnabled_DEPRECATED() in http/tests/adClickAttribution/conversion-disabled-in-ephemeral-session.html 4 https://bugs.webkit.org/show_bug.cgi?id=201596 5 6 Reviewed by Alex Christensen. 7 8 Allow WKFramePolicyListenerUseWithPolicies() C API to switch to a persistent non-default session. 9 This is important since WebKitTestRunner is not using the default session anymore and I need to 10 be able to switch it back to its normal session after going to an ephemeral one. 11 12 * UIProcess/API/C/WKFramePolicyListener.cpp: 13 (useWithPolicies): 14 1 15 2019-09-09 Alex Christensen <achristensen@webkit.org> 2 16 -
trunk/Source/WebKit/UIProcess/API/C/WKFramePolicyListener.cpp
r235559 r249675 54 54 static void useWithPolicies(WKFramePolicyListenerRef policyListenerRef, WKWebsitePoliciesRef websitePolicies, ProcessSwapRequestedByClient processSwapRequestedByClient) 55 55 { 56 if (auto* websiteDataStore = toImpl(websitePolicies)->websiteDataStore()) {57 auto sessionID = websiteDataStore->websiteDataStore().sessionID();58 RELEASE_ASSERT_WITH_MESSAGE(sessionID.isEphemeral() || sessionID == PAL::SessionID::defaultSessionID(), "If WebsitePolicies specifies a WebsiteDataStore, the data store's session must be default or non-persistent.");59 }60 61 56 toImpl(policyListenerRef)->use(toImpl(websitePolicies), processSwapRequestedByClient); 62 57 } -
trunk/Source/WebKit/UIProcess/Cocoa/NavigationState.mm
r249096 r249675 595 595 if (apiWebsitePolicies) { 596 596 if (auto* websiteDataStore = apiWebsitePolicies->websiteDataStore()) { 597 auto sessionID = websiteDataStore->websiteDataStore().sessionID();598 if (!sessionID.isEphemeral() && sessionID != PAL::SessionID::defaultSessionID())599 [NSException raise:NSInvalidArgumentException format:@"WKWebpagePreferences._websiteDataStore must be nil, default, or non-persistent."];600 597 if (subframeNavigation) 601 598 [NSException raise:NSInvalidArgumentException format:@"WKWebpagePreferences._websiteDataStore must be nil for subframe navigations."]; -
trunk/Tools/ChangeLog
r249667 r249675 1 2019-09-09 Chris Dumez <cdumez@apple.com> 2 3 Stop using testRunner.setPrivateBrowsingEnabled_DEPRECATED() in http/tests/adClickAttribution/conversion-disabled-in-ephemeral-session.html 4 https://bugs.webkit.org/show_bug.cgi?id=201596 5 6 Reviewed by Alex Christensen. 7 8 Add new testRunner.setShouldSwapToEphemeralSessionOnNextNavigation() / testRunner.setShouldSwapToDefaultSessionOnNextNavigation() 9 test functions to support dynamic switching between ephemeral and default/persistent session in layout tests. The new methods 10 do the right thing for WebKit2 and truly switch session, unlike setPrivateBrowsingEnabled_DEPRECATED() which was merely making 11 the WebCore::Document think it changed session. 12 13 * DumpRenderTree/TestRunner.cpp: 14 (setShouldSwapToEphemeralSessionOnNextNavigationCallback): 15 (setShouldSwapToDefaultSessionOnNextNavigationCallback): 16 (TestRunner::staticFunctions): 17 (TestRunner::willNavigate): 18 * DumpRenderTree/TestRunner.h: 19 (TestRunner::setShouldSwapToEphemeralSessionOnNextNavigation): 20 (TestRunner::setShouldSwapToDefaultSessionOnNextNavigation): 21 * DumpRenderTree/mac/FrameLoadDelegate.mm: 22 (-[FrameLoadDelegate webView:didStartProvisionalLoadForFrame:]): 23 * WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl: 24 * WebKitTestRunner/InjectedBundle/TestRunner.cpp: 25 (WTR::TestRunner::setShouldSwapToEphemeralSessionOnNextNavigation): 26 (WTR::TestRunner::setShouldSwapToDefaultSessionOnNextNavigation): 27 * WebKitTestRunner/InjectedBundle/TestRunner.h: 28 * WebKitTestRunner/TestController.cpp: 29 (WTR::TestController::decidePolicyForNavigationAction): 30 * WebKitTestRunner/TestController.h: 31 (WTR::TestController::setShouldSwapToEphemeralSessionOnNextNavigation): 32 (WTR::TestController::setShouldSwapToDefaultSessionOnNextNavigation): 33 * WebKitTestRunner/TestInvocation.cpp: 34 (WTR::TestInvocation::didReceiveSynchronousMessageFromInjectedBundle): 35 1 36 2019-09-09 Aakash Jain <aakash_jain@apple.com> 2 37 -
trunk/Tools/DumpRenderTree/DefaultPolicyDelegate.mm
r249672 r249675 7 7 // 8 8 9 #import "config.h" 9 10 #import "DefaultPolicyDelegate.h" 10 11 12 #import "DumpRenderTree.h" 13 #import "TestRunner.h" 11 14 #import <WebKit/WebPolicyDelegatePrivate.h> 12 15 #import <WebKit/WebViewPrivate.h> … … 17 20 { 18 21 if ([WebView _canHandleRequest:request]) { 22 if (![frame frameElement]) 23 gTestRunner->willNavigate(); 19 24 [listener use]; 20 25 return; … … 22 27 23 28 WebNavigationType navType = (WebNavigationType)[[actionInformation objectForKey:WebActionNavigationTypeKey] intValue]; 24 if (navType == WebNavigationTypePlugInRequest) { 29 if (static_cast<unsigned>(navType) == static_cast<unsigned>(WebNavigationTypePlugInRequest)) { 30 if (![frame frameElement]) 31 gTestRunner->willNavigate(); 25 32 [listener use]; 26 33 return; -
trunk/Tools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj
r247898 r249675 67 67 1A215BE711F27658008AD0F5 /* DocumentOpenInDestroyStream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A215A7511F26072008AD0F5 /* DocumentOpenInDestroyStream.cpp */; }; 68 68 1A24BAA9120734EE00FBB059 /* NPRuntimeObjectFromDestroyedPlugin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A24BAA8120734EE00FBB059 /* NPRuntimeObjectFromDestroyedPlugin.cpp */; }; 69 1A2FB84F178C80930059FD96 /* DefaultPolicyDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A2FB84D178C80930059FD96 /* DefaultPolicyDelegate.m */; };69 1A2FB84F178C80930059FD96 /* DefaultPolicyDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A2FB84D178C80930059FD96 /* DefaultPolicyDelegate.mm */; }; 70 70 1A31EB3813466AC100017372 /* ConvertPoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A31EB3713466AC100017372 /* ConvertPoint.cpp */; }; 71 71 1A3E28AA1311D73B00501349 /* GetURLWithJavaScriptURLDestroyingPlugin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A3E28A91311D73B00501349 /* GetURLWithJavaScriptURLDestroyingPlugin.cpp */; }; … … 269 269 1A24BAA8120734EE00FBB059 /* NPRuntimeObjectFromDestroyedPlugin.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NPRuntimeObjectFromDestroyedPlugin.cpp; sourceTree = "<group>"; }; 270 270 1A2FB84C178C80920059FD96 /* DefaultPolicyDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DefaultPolicyDelegate.h; sourceTree = "<group>"; }; 271 1A2FB84D178C80930059FD96 /* DefaultPolicyDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DefaultPolicyDelegate.m; sourceTree = "<group>"; };271 1A2FB84D178C80930059FD96 /* DefaultPolicyDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DefaultPolicyDelegate.mm; sourceTree = "<group>"; }; 272 272 1A31EB3713466AC100017372 /* ConvertPoint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ConvertPoint.cpp; sourceTree = "<group>"; }; 273 273 1A3E28A91311D73B00501349 /* GetURLWithJavaScriptURLDestroyingPlugin.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GetURLWithJavaScriptURLDestroyingPlugin.cpp; sourceTree = "<group>"; }; … … 483 483 A134E53418905E6C00901D06 /* config.h */, 484 484 1A2FB84C178C80920059FD96 /* DefaultPolicyDelegate.h */, 485 1A2FB84D178C80930059FD96 /* DefaultPolicyDelegate.m */,485 1A2FB84D178C80930059FD96 /* DefaultPolicyDelegate.mm */, 486 486 9830F31E15C81181005AB206 /* DumpRenderTreeCommon.cpp */, 487 487 32A70AAB03705E1F00C91783 /* DumpRenderTreePrefix.h */, … … 1163 1163 F44A531D21B89A4D00DBB99C /* ClassMethodSwizzler.mm in Sources */, 1164 1164 53CBB832134E42F3001CE6A4 /* CyclicRedundancyCheck.cpp in Sources */, 1165 1A2FB84F178C80930059FD96 /* DefaultPolicyDelegate.m in Sources */,1165 1A2FB84F178C80930059FD96 /* DefaultPolicyDelegate.mm in Sources */, 1166 1166 BCA18C470C9B5B9400114369 /* DumpRenderTree.mm in Sources */, 1167 1167 A1158D581892740C0088C17B /* DumpRenderTreeBrowserView.mm in Sources */, -
trunk/Tools/DumpRenderTree/TestRunner.cpp
r249542 r249675 1125 1125 TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); 1126 1126 controller->setPrivateBrowsingEnabled(JSValueToBoolean(context, arguments[0])); 1127 1128 return JSValueMakeUndefined(context); 1129 } 1130 1131 static JSValueRef setShouldSwapToEphemeralSessionOnNextNavigationCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) 1132 { 1133 // Has mac & windows implementation 1134 if (argumentCount < 1) 1135 return JSValueMakeUndefined(context); 1136 1137 TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); 1138 controller->setShouldSwapToEphemeralSessionOnNextNavigation(JSValueToBoolean(context, arguments[0])); 1139 1140 return JSValueMakeUndefined(context); 1141 } 1142 1143 static JSValueRef setShouldSwapToDefaultSessionOnNextNavigationCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) 1144 { 1145 // Has mac & windows implementation 1146 if (argumentCount < 1) 1147 return JSValueMakeUndefined(context); 1148 1149 TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); 1150 controller->setShouldSwapToDefaultSessionOnNextNavigation(JSValueToBoolean(context, arguments[0])); 1127 1151 1128 1152 return JSValueMakeUndefined(context); … … 2221 2245 { "setPrinting", setPrintingCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 2222 2246 { "setPrivateBrowsingEnabled_DEPRECATED", setPrivateBrowsingEnabledCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 2247 { "setShouldSwapToEphemeralSessionOnNextNavigation", setShouldSwapToEphemeralSessionOnNextNavigationCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 2248 { "setShouldSwapToDefaultSessionOnNextNavigation", setShouldSwapToDefaultSessionOnNextNavigationCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 2223 2249 { "setSerializeHTTPLoads", setSerializeHTTPLoadsCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 2224 2250 { "setSpatialNavigationEnabled", setSpatialNavigationEnabledCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, … … 2536 2562 clearTestRunnerCallbacks(); 2537 2563 } 2564 2565 void TestRunner::willNavigate() 2566 { 2567 if (m_shouldSwapToEphemeralSessionOnNextNavigation || m_shouldSwapToDefaultSessionOnNextNavigation) { 2568 ASSERT(m_shouldSwapToEphemeralSessionOnNextNavigation != m_shouldSwapToDefaultSessionOnNextNavigation); 2569 setPrivateBrowsingEnabled(m_shouldSwapToEphemeralSessionOnNextNavigation); 2570 } 2571 } -
trunk/Tools/DumpRenderTree/TestRunner.h
r248856 r249675 117 117 void setPopupBlockingEnabled(bool); 118 118 void setPrivateBrowsingEnabled(bool); 119 120 void willNavigate(); 121 void setShouldSwapToEphemeralSessionOnNextNavigation(bool shouldSwap) { m_shouldSwapToEphemeralSessionOnNextNavigation = shouldSwap; } 122 void setShouldSwapToDefaultSessionOnNextNavigation(bool shouldSwap) { m_shouldSwapToDefaultSessionOnNextNavigation = shouldSwap; } 123 119 124 void setTabKeyCyclesThroughElements(bool); 120 125 void setUserStyleSheetEnabled(bool flag); … … 459 464 bool m_dumpJSConsoleLogInStdErr { false }; 460 465 bool m_didCancelClientRedirect { false }; 466 bool m_shouldSwapToEphemeralSessionOnNextNavigation { false }; 467 bool m_shouldSwapToDefaultSessionOnNextNavigation { false }; 461 468 462 469 double m_databaseDefaultQuota { -1 }; -
trunk/Tools/DumpRenderTree/mac/PolicyDelegate.mm
r232452 r249675 86 86 printf("%s\n", [message UTF8String]); 87 87 88 if (permissiveDelegate) 88 if (permissiveDelegate) { 89 if (![frame frameElement]) 90 gTestRunner->willNavigate(); 89 91 [listener use]; 90 else92 } else 91 93 [listener ignore]; 92 94 -
trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl
r249542 r249675 106 106 void setShouldDownloadUndisplayableMIMETypes(boolean value); 107 107 108 // DEPRECATED: Use <!-- webkit-test-runner [ useEphemeralSession=true ] --> instead. 108 // DEPRECATED: Use <!-- webkit-test-runner [ useEphemeralSession=true ] --> instead, or 109 // testRunner.setShouldSwapToEphemeralSessionOnNextNavigation() / testRunner.setShouldSwapToDefaultSessionOnNextNavigation(). 109 110 void setPrivateBrowsingEnabled_DEPRECATED(boolean value); 110 111 … … 253 254 254 255 void setAllowsAnySSLCertificate(boolean value); 256 257 void setShouldSwapToEphemeralSessionOnNextNavigation(boolean value); 258 void setShouldSwapToDefaultSessionOnNextNavigation(boolean value); 255 259 256 260 // Secure text input mode (Mac only) -
trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp
r249575 r249675 501 501 } 502 502 503 void TestRunner::setShouldSwapToEphemeralSessionOnNextNavigation(bool shouldSwap) 504 { 505 auto& injectedBundle = InjectedBundle::singleton(); 506 507 WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("SetShouldSwapToEphemeralSessionOnNextNavigation")); 508 WKRetainPtr<WKBooleanRef> messageBody = adoptWK(WKBooleanCreate(shouldSwap)); 509 WKBundlePagePostSynchronousMessageForTesting(injectedBundle.page()->page(), messageName.get(), messageBody.get(), nullptr); 510 } 511 512 void TestRunner::setShouldSwapToDefaultSessionOnNextNavigation(bool shouldSwap) 513 { 514 auto& injectedBundle = InjectedBundle::singleton(); 515 516 WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("SetShouldSwapToDefaultSessionOnNextNavigation")); 517 WKRetainPtr<WKBooleanRef> messageBody = adoptWK(WKBooleanCreate(shouldSwap)); 518 WKBundlePagePostSynchronousMessageForTesting(injectedBundle.page()->page(), messageName.get(), messageBody.get(), nullptr); 519 } 520 503 521 void TestRunner::setAllowUniversalAccessFromFileURLs(bool enabled) 504 522 { -
trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h
r249542 r249675 128 128 void setAsynchronousSpellCheckingEnabled(bool); 129 129 void setAllowsAnySSLCertificate(bool); 130 void setShouldSwapToEphemeralSessionOnNextNavigation(bool); 131 void setShouldSwapToDefaultSessionOnNextNavigation(bool); 130 132 void setEncryptedMediaAPIEnabled(bool); 131 133 void setMediaDevicesEnabled(bool); -
trunk/Tools/WebKitTestRunner/TestController.cpp
r249619 r249675 69 69 #include <WebKit/WKWebsiteDataStoreConfigurationRef.h> 70 70 #include <WebKit/WKWebsiteDataStoreRef.h> 71 #include <WebKit/WKWebsitePolicies.h> 71 72 #include <algorithm> 72 73 #include <cstdio> … … 2812 2813 WKRetainPtr<WKNavigationActionRef> retainedNavigationAction { navigationAction }; 2813 2814 const bool shouldIgnore { m_policyDelegateEnabled && !m_policyDelegatePermissive }; 2814 auto decisionFunction = [shouldIgnore, retainedListener, retainedNavigationAction ]() {2815 auto decisionFunction = [shouldIgnore, retainedListener, retainedNavigationAction, shouldSwapToEphemeralSessionOnNextNavigation = m_shouldSwapToEphemeralSessionOnNextNavigation, shouldSwapToDefaultSessionOnNextNavigation = m_shouldSwapToDefaultSessionOnNextNavigation]() { 2815 2816 if (shouldIgnore) 2816 2817 WKFramePolicyListenerIgnore(retainedListener.get()); 2817 2818 else if (WKNavigationActionShouldPerformDownload(retainedNavigationAction.get())) 2818 2819 WKFramePolicyListenerDownload(retainedListener.get()); 2819 else 2820 WKFramePolicyListenerUse(retainedListener.get()); 2820 else { 2821 if (shouldSwapToEphemeralSessionOnNextNavigation || shouldSwapToDefaultSessionOnNextNavigation) { 2822 ASSERT(shouldSwapToEphemeralSessionOnNextNavigation != shouldSwapToDefaultSessionOnNextNavigation); 2823 auto policies = adoptWK(WKWebsitePoliciesCreate()); 2824 WKRetainPtr<WKWebsiteDataStoreRef> newSession = TestController::websiteDataStore(); 2825 if (shouldSwapToEphemeralSessionOnNextNavigation) 2826 newSession = adoptWK(WKWebsiteDataStoreCreateNonPersistentDataStore()); 2827 WKWebsitePoliciesSetDataStore(policies.get(), newSession.get()); 2828 WKFramePolicyListenerUseWithPolicies(retainedListener.get(), policies.get()); 2829 } else 2830 WKFramePolicyListenerUse(retainedListener.get()); 2831 } 2821 2832 }; 2833 m_shouldSwapToEphemeralSessionOnNextNavigation = false; 2834 m_shouldSwapToDefaultSessionOnNextNavigation = false; 2822 2835 2823 2836 if (m_shouldDecideNavigationPolicyAfterDelay) -
trunk/Tools/WebKitTestRunner/TestController.h
r249614 r249675 187 187 void setAuthenticationPassword(String password) { m_authenticationPassword = password; } 188 188 void setAllowsAnySSLCertificate(bool); 189 void setShouldSwapToEphemeralSessionOnNextNavigation(bool value) { m_shouldSwapToEphemeralSessionOnNextNavigation = value; } 190 void setShouldSwapToDefaultSessionOnNextNavigation(bool value) { m_shouldSwapToDefaultSessionOnNextNavigation = value; } 189 191 190 192 void setBlockAllPlugins(bool shouldBlock); … … 594 596 bool m_shouldDismissJavaScriptAlertsAsynchronously { false }; 595 597 bool m_allowsAnySSLCertificate { true }; 598 bool m_shouldSwapToEphemeralSessionOnNextNavigation { false }; 599 bool m_shouldSwapToDefaultSessionOnNextNavigation { false }; 596 600 }; 597 601 -
trunk/Tools/WebKitTestRunner/TestInvocation.cpp
r249619 r249675 926 926 return nullptr; 927 927 } 928 929 if (WKStringIsEqualToUTF8CString(messageName, "SetShouldSwapToEphemeralSessionOnNextNavigation")) { 930 TestController::singleton().setShouldSwapToEphemeralSessionOnNextNavigation(WKBooleanGetValue(static_cast<WKBooleanRef>(messageBody))); 931 return nullptr; 932 } 933 934 if (WKStringIsEqualToUTF8CString(messageName, "SetShouldSwapToDefaultSessionOnNextNavigation")) { 935 TestController::singleton().setShouldSwapToDefaultSessionOnNextNavigation(WKBooleanGetValue(static_cast<WKBooleanRef>(messageBody))); 936 return nullptr; 937 } 928 938 929 939 if (WKStringIsEqualToUTF8CString(messageName, "ImageCountInGeneralPasteboard")) {
Note:
See TracChangeset
for help on using the changeset viewer.