Changeset 181446 in webkit
- Timestamp:
- Mar 12, 2015, 11:38:11 AM (11 years ago)
- Location:
- trunk
- Files:
-
- 14 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/platform/gtk/TestExpectations (modified) (1 diff)
-
LayoutTests/platform/mac-wk2/TestExpectations (modified) (1 diff)
-
Source/WebKit2/ChangeLog (modified) (1 diff)
-
Source/WebKit2/UIProcess/WebCookieManagerProxy.cpp (modified) (2 diffs)
-
Source/WebKit2/UIProcess/WebProcessPool.h (modified) (1 diff)
-
Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundle.cpp (modified) (1 diff)
-
Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePrivate.h (modified) (1 diff)
-
Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp (modified) (1 diff)
-
Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.h (modified) (1 diff)
-
Tools/ChangeLog (modified) (1 diff)
-
Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp (modified) (1 diff)
-
Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp (modified) (1 diff)
-
Tools/WebKitTestRunner/TestInvocation.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r181441 r181446 1 2015-03-12 Alexey Proskuryakov <ap@apple.com> 2 3 testRunner.setAlwaysAcceptCookies does not work with NetworkProcess 4 https://bugs.webkit.org/show_bug.cgi?id=138687 5 6 Unreviewed (only code changes were reviewed). 7 8 * platform/gtk/TestExpectations: 9 * platform/mac-wk2/TestExpectations: 10 Unskip tests that used to be affected. 11 1 12 2015-03-12 Simon Fraser <simon.fraser@apple.com> 2 13 -
trunk/LayoutTests/platform/gtk/TestExpectations
r181291 r181446 1558 1558 webkit.org/b/139357 js/dom/constructor-length.html [ Failure ] 1559 1559 1560 # testRunner.setAlwaysAcceptCookies does not work with NetworkProcess1561 webkit.org/b/138687 http/tests/xmlhttprequest/cross-origin-cookie-storage.html [ Skip ]1562 1563 1560 # PingLoader is still in WebProcess. As a result, this test fails and also fails to delete its cookie, breaking many other cookie tests. 1564 1561 webkit.org/b/138688 http/tests/navigation/ping-cookie.html [ Skip ] -
trunk/LayoutTests/platform/mac-wk2/TestExpectations
r181031 r181446 469 469 storage/websql/private-browsing-noread-nowrite.html [ Skip ] 470 470 471 # testRunner.setAlwaysAcceptCookies does not work with NetworkProcess472 webkit.org/b/138687 http/tests/cookies/third-party-cookie-relaxing.html [ Skip ]473 webkit.org/b/138687 http/tests/xmlhttprequest/cross-origin-cookie-storage.html [ Skip ]474 475 471 # FIXME: Needs bugzilla (<rdar://problem/12829991>) 476 472 # PPT: PingLoader is still in WebProcess. As a result, this test fails and also fails to delete its cookie, breaking many other cookie tests. -
trunk/Source/WebKit2/ChangeLog
r181445 r181446 1 2015-03-12 Alexey Proskuryakov <ap@apple.com> 2 3 testRunner.setAlwaysAcceptCookies does not work with NetworkProcess 4 https://bugs.webkit.org/show_bug.cgi?id=138687 5 6 Reviewed by Carlos Garcia Campos. 7 8 * UIProcess/WebCookieManagerProxy.cpp: 9 (WebKit::WebCookieManagerProxy::setHTTPCookieAcceptPolicy): Don't change system-wide 10 cookie accept policy when in testing mode. Also, update the policy in WebProcesses too, 11 as we still do some networking there. 12 13 * UIProcess/WebProcessPool.h: 14 * WebProcess/InjectedBundle/API/c/WKBundle.cpp: 15 (WKBundleSetAlwaysAcceptCookies): Deleted. 16 * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h: 17 * WebProcess/InjectedBundle/InjectedBundle.cpp: 18 (WebKit::InjectedBundle::setAlwaysAcceptCookies): Deleted. 19 * WebProcess/InjectedBundle/InjectedBundle.h: 20 Remove WKBundleSetAlwaysAcceptCookies SPI, as WKTR now uses an API in UI process. 21 1 22 2015-03-12 Anders Carlsson <andersca@apple.com> 2 23 -
trunk/Source/WebKit2/UIProcess/WebCookieManagerProxy.cpp
r177692 r181446 153 153 { 154 154 #if PLATFORM(COCOA) 155 persistHTTPCookieAcceptPolicy(policy); 155 if (!processPool()->isUsingTestingNetworkSession()) 156 persistHTTPCookieAcceptPolicy(policy); 156 157 #endif 157 158 #if USE(SOUP) … … 159 160 #endif 160 161 161 processPool()->sendToNetworkingProcessRelaunchingIfNecessary(Messages::WebCookieManager::SetHTTPCookieAcceptPolicy(policy)); 162 // The policy is not sent to newly created processes (only Soup does that via setInitialHTTPCookieAcceptPolicy()). This is not a serious problem, because: 163 // - When testing, we only have one WebProcess and one NetworkProcess, and WebKitTestRunner never restarts them; 164 // - When not testing, Cocoa has the policy persisted, and thus new processes use it (even for ephemeral sessions). 165 processPool()->sendToAllProcesses(Messages::WebCookieManager::SetHTTPCookieAcceptPolicy(policy)); 166 #if ENABLE(NETWORK_PROCESS) 167 if (processPool()->usesNetworkProcess()) 168 processPool()->sendToNetworkingProcess(Messages::WebCookieManager::SetHTTPCookieAcceptPolicy(policy)); 169 #endif 162 170 } 163 171 -
trunk/Source/WebKit2/UIProcess/WebProcessPool.h
r180354 r181446 247 247 248 248 void useTestingNetworkSession(); 249 bool isUsingTestingNetworkSession() const { return m_shouldUseTestingNetworkSession; } 249 250 250 251 void allowSpecificHTTPSCertificateForHost(const WebCertificateInfo*, const String& host); -
trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundle.cpp
r180149 r181446 84 84 } 85 85 86 void WKBundleSetAlwaysAcceptCookies(WKBundleRef bundleRef, bool accept)87 {88 toImpl(bundleRef)->setAlwaysAcceptCookies(accept);89 }90 91 86 void WKBundleAddUserScript(WKBundleRef bundleRef, WKBundlePageGroupRef pageGroupRef, WKBundleScriptWorldRef scriptWorldRef, WKStringRef sourceRef, WKURLRef urlRef, WKArrayRef whitelistRef, WKArrayRef blacklistRef, _WKUserScriptInjectionTime injectionTimeRef, WKUserContentInjectedFrames injectedFramesRef) 92 87 { -
trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePrivate.h
r180149 r181446 41 41 #endif 42 42 43 // TestRunner only SPI 44 WK_EXPORT void WKBundleSetAlwaysAcceptCookies(WKBundleRef bundle, bool); 43 // TestRunner only SPIs. 45 44 // Will make WebProcess ignore this preference until a preferences change notification, only for WebKitTestRunner use. 46 45 WK_EXPORT void WKBundleOverrideBoolPreferenceForTestRunner(WKBundleRef bundle, WKBundlePageGroupRef pageGroup, WKStringRef preference, bool enabled); -
trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp
r180963 r181446 137 137 } 138 138 139 void InjectedBundle::setAlwaysAcceptCookies(bool accept)140 {141 WebProcess::singleton().supplement<WebCookieManager>()->setHTTPCookieAcceptPolicy(accept ? HTTPCookieAcceptPolicyAlways : HTTPCookieAcceptPolicyOnlyFromMainDocumentDomain);142 }143 144 139 void InjectedBundle::overrideBoolPreferenceForTestRunner(WebPageGroupProxy* pageGroup, const String& preference, bool enabled) 145 140 { -
trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.h
r180156 r181446 98 98 99 99 // TestRunner only SPI 100 void setAlwaysAcceptCookies(bool);101 100 void overrideBoolPreferenceForTestRunner(WebPageGroupProxy*, const String& preference, bool enabled); 102 101 void overrideXSSAuditorEnabledForTestRunner(WebPageGroupProxy* pageGroup, bool enabled); -
trunk/Tools/ChangeLog
r181440 r181446 1 2015-03-12 Alexey Proskuryakov <ap@apple.com> 2 3 testRunner.setAlwaysAcceptCookies does not work with NetworkProcess 4 https://bugs.webkit.org/show_bug.cgi?id=138687 5 6 Reviewed by Carlos Garcia Campos. 7 8 Always change cookie policy from UI process, as changing it from WebProcess doesn't 9 affect other processes. 10 11 The implementation is imperfect, because the change happens asynchronously, but I 12 don't expect it to be a problem in practice. 13 14 * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp: 15 (WTR::InjectedBundle::beginTesting): 16 * WebKitTestRunner/InjectedBundle/TestRunner.cpp: 17 (WTR::TestRunner::setAlwaysAcceptCookies): 18 * WebKitTestRunner/TestInvocation.cpp: 19 (WTR::TestInvocation::invoke): 20 (WTR::TestInvocation::didReceiveSynchronousMessageFromInjectedBundle): 21 1 22 2015-03-12 Csaba Osztrogonác <ossy@webkit.org> 2 23 -
trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp
r180149 r181446 250 250 WKBundleSetPluginsEnabled(m_bundle, m_pageGroup, true); 251 251 WKBundleSetPopupBlockingEnabled(m_bundle, m_pageGroup, false); 252 WKBundleSetAlwaysAcceptCookies(m_bundle, false); // FIXME: Do this from UI process, so that Networking process gets the preference, too.253 252 WKBundleSetSerialLoadingEnabled(m_bundle, false); 254 253 -
trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp
r180149 r181446 602 602 void TestRunner::setAlwaysAcceptCookies(bool accept) 603 603 { 604 WKBundleSetAlwaysAcceptCookies(InjectedBundle::singleton().bundle(), accept); 604 WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("SetAlwaysAcceptCookies")); 605 606 WKRetainPtr<WKBooleanRef> messageBody(AdoptWK, WKBooleanCreate(accept)); 607 608 WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), 0); 605 609 } 606 610 -
trunk/Tools/WebKitTestRunner/TestInvocation.cpp
r180636 r181446 32 32 #include "TestController.h" 33 33 #include <WebKit/WKContextPrivate.h> 34 #include <WebKit/WKCookieManager.h> 34 35 #include <WebKit/WKData.h> 35 36 #include <WebKit/WKDictionary.h> … … 152 153 TestController::singleton().setShouldLogHistoryClientCallbacks(shouldLogHistoryClientCallbacks()); 153 154 155 WKCookieManagerSetHTTPCookieAcceptPolicy(WKContextGetCookieManager(TestController::singleton().context()), kWKHTTPCookieAcceptPolicyOnlyFromMainDocumentDomain); 156 154 157 // FIXME: We should clear out visited links here. 155 158 … … 643 646 return result; 644 647 } 648 649 if (WKStringIsEqualToUTF8CString(messageName, "SetAlwaysAcceptCookies")) { 650 WKBooleanRef accept = static_cast<WKBooleanRef>(messageBody); 651 WKHTTPCookieAcceptPolicy policy = WKBooleanGetValue(accept) ? kWKHTTPCookieAcceptPolicyAlways : kWKHTTPCookieAcceptPolicyOnlyFromMainDocumentDomain; 652 // FIXME: This updates the policy in WebProcess and in NetworkProcess asynchronously, which might break some tests' expectations. 653 WKCookieManagerSetHTTPCookieAcceptPolicy(WKContextGetCookieManager(TestController::singleton().context()), policy); 654 return 0; 655 } 656 645 657 ASSERT_NOT_REACHED(); 646 658 return 0;
Note:
See TracChangeset
for help on using the changeset viewer.