Changeset 248047 in webkit
- Timestamp:
- Jul 31, 2019 10:37:51 AM (5 years ago)
- Location:
- trunk
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r248039 r248047 1 2019-07-31 Chris Dumez <cdumez@apple.com> 2 3 REGRESSION (r247486?): Flaky API Test TestWebKitAPI.WKWebView.LocalStorageProcessSuspends 4 https://bugs.webkit.org/show_bug.cgi?id=200086 5 <rdar://problem/53501721> 6 7 Reviewed by Alex Christensen. 8 9 The test would first send a ProcessWillSuspendImminently IPC to the NetworkProcess and then 10 run JS in the WebContent process, which would in turn send IPC to the NetworkProcess. The 11 test was flaky because it expected the network process to receive the IPC from the UIProcess 12 *before* the one from the WebContent process. However, there is no guarantee about ordering 13 from IPC messages coming from different connections. 14 15 To address the flakiness, this patch introduces a new ProcessWillSuspendImminentlyForTesting 16 synchronous IPC and uses this instead. As a result, it is now guaranteed that the network 17 process processes this IPC *before* receiving any IPC from the WebContent process that is 18 the result of IPC from the UIProcess. 19 20 * NetworkProcess/NetworkProcess.cpp: 21 (WebKit::NetworkProcess::processWillSuspendImminentlyForTestingSync): 22 * NetworkProcess/NetworkProcess.h: 23 * NetworkProcess/NetworkProcess.messages.in: 24 * UIProcess/API/Cocoa/WKProcessPool.mm: 25 (-[WKProcessPool _sendNetworkProcessWillSuspendImminently]): 26 * UIProcess/Network/NetworkProcessProxy.cpp: 27 (WebKit::NetworkProcessProxy::sendProcessWillSuspendImminentlyForTesting): 28 * UIProcess/Network/NetworkProcessProxy.h: 29 * UIProcess/WebProcessPool.cpp: 30 (WebKit::WebProcessPool::sendNetworkProcessWillSuspendImminentlyForTesting): 31 (WebKit::WebProcessPool::sendNetworkProcessWillSuspendImminently): Deleted. 32 * UIProcess/WebProcessPool.h: 33 1 34 2019-07-31 Wenson Hsieh <wenson_hsieh@apple.com> 2 35 -
trunk/Source/WebKit/NetworkProcess/NetworkProcess.cpp
r248010 r248047 2111 2111 } 2112 2112 2113 void NetworkProcess::processWillSuspendImminentlyForTestingSync(CompletionHandler<void()>&& completionHandler) 2114 { 2115 processWillSuspendImminently(); 2116 completionHandler(); 2117 } 2118 2113 2119 void NetworkProcess::prepareToSuspend() 2114 2120 { -
trunk/Source/WebKit/NetworkProcess/NetworkProcess.h
r248010 r248047 182 182 183 183 void processWillSuspendImminently(); 184 void processWillSuspendImminentlyForTestingSync(CompletionHandler<void()>&&); 184 185 void prepareToSuspend(); 185 186 void cancelPrepareToSuspend(); -
trunk/Source/WebKit/NetworkProcess/NetworkProcess.messages.in
r247270 r248047 80 80 81 81 ProcessWillSuspendImminently() 82 ProcessWillSuspendImminentlyForTestingSync() -> () Synchronous 82 83 PrepareToSuspend() 83 84 CancelPrepareToSuspend() -
trunk/Source/WebKit/UIProcess/API/Cocoa/WKProcessPool.mm
r247759 r248047 440 440 - (void)_sendNetworkProcessWillSuspendImminently 441 441 { 442 _processPool->sendNetworkProcessWillSuspendImminently ();442 _processPool->sendNetworkProcessWillSuspendImminentlyForTesting(); 443 443 } 444 444 -
trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp
r247868 r248047 982 982 send(Messages::NetworkProcess::ProcessWillSuspendImminently(), 0); 983 983 } 984 985 void NetworkProcessProxy::sendProcessWillSuspendImminentlyForTesting() 986 { 987 if (canSendMessage()) 988 sendSync(Messages::NetworkProcess::ProcessWillSuspendImminentlyForTestingSync(), Messages::NetworkProcess::ProcessWillSuspendImminentlyForTestingSync::Reply(), 0); 989 } 984 990 985 991 void NetworkProcessProxy::sendPrepareToSuspend() -
trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.h
r247822 r248047 186 186 void sendProcessWillSuspendImminently() final; 187 187 void sendProcessDidResume() final; 188 189 void sendProcessWillSuspendImminentlyForTesting(); 188 190 189 191 private: -
trunk/Source/WebKit/UIProcess/WebProcessPool.cpp
r247933 r248047 1777 1777 } 1778 1778 1779 void WebProcessPool::sendNetworkProcessWillSuspendImminently ()1779 void WebProcessPool::sendNetworkProcessWillSuspendImminentlyForTesting() 1780 1780 { 1781 1781 if (m_networkProcess) 1782 m_networkProcess->sendProcessWillSuspendImminently ();1782 m_networkProcess->sendProcessWillSuspendImminentlyForTesting(); 1783 1783 } 1784 1784 -
trunk/Source/WebKit/UIProcess/WebProcessPool.h
r247759 r248047 313 313 void clearPermanentCredentialsForProtectionSpace(WebCore::ProtectionSpace&&, CompletionHandler<void()>&&); 314 314 void terminateNetworkProcess(); 315 void sendNetworkProcessWillSuspendImminently ();315 void sendNetworkProcessWillSuspendImminentlyForTesting(); 316 316 void sendNetworkProcessDidResume(); 317 317 void terminateServiceWorkerProcesses(); -
trunk/Tools/ChangeLog
r248039 r248047 1 2019-07-31 Chris Dumez <cdumez@apple.com> 2 3 REGRESSION (r247486?): Flaky API Test TestWebKitAPI.WKWebView.LocalStorageProcessSuspends 4 https://bugs.webkit.org/show_bug.cgi?id=200086 5 <rdar://problem/53501721> 6 7 Reviewed by Alex Christensen. 8 9 re-enable the API test. 10 11 * TestWebKitAPI/Tests/WebKitCocoa/LocalStoragePersistence.mm: 12 (TEST): 13 1 14 2019-07-31 Wenson Hsieh <wenson_hsieh@apple.com> 2 15 -
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/LocalStoragePersistence.mm
r247929 r248047 113 113 } 114 114 115 TEST(WKWebView, DISABLED_LocalStorageProcessSuspends)115 TEST(WKWebView, LocalStorageProcessSuspends) 116 116 { 117 117 readyToContinue = false;
Note: See TracChangeset
for help on using the changeset viewer.