[WKTR] Avoid starting new NetworkProcesses unnecessarily when running the layout...
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 20 Feb 2019 18:34:44 +0000 (18:34 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 20 Feb 2019 18:34:44 +0000 (18:34 +0000)
commitb8e7fd08101338f4f1efa6f43619e88ad7083d31
tree7db1e8ed9b8c45c5a0b1c6cd957d9eae4c716a54
parentd94f2b5b9afa53e3b2acce55001730b694db19d8
[WKTR] Avoid starting new NetworkProcesses unnecessarily when running the layout tests
https://bugs.webkit.org/show_bug.cgi?id=194829
<rdar://problem/47889906>

Reviewed by Alexey Proskuryakov.

Every time the TestOptions were changing we were creating both a new Web view and
a new WKContext, which would start a new Network process. In most cases, we only
need to contruct a new Web view and we do can keep reusing the same WKContext.
This patch implements this optimization and thus avoids spinning a lot of new
Network processes while running the layout tests.

* WebKitTestRunner/TestController.cpp:
(WTR::TestController::generateContextConfiguration const):
(WTR::TestController::generatePageConfiguration):
(WTR::TestController::createWebViewWithOptions):
(WTR::TestController::resetPreferencesToConsistentValues):
(WTR::updateTestOptionsFromTestHeader):
* WebKitTestRunner/TestController.h:
* WebKitTestRunner/TestOptions.h:
(WTR::TestOptions::ContextOptions::hasSameInitializationOptions const):
(WTR::TestOptions::ContextOptions::shouldEnableProcessSwapOnNavigation const):
(WTR::TestOptions::hasSameInitializationOptions const):
(WTR::TestOptions::shouldEnableProcessSwapOnNavigation const): Deleted.
* WebKitTestRunner/cocoa/TestControllerCocoa.mm:
(WTR::TestController::platformAddTestOptions const):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241821 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Tools/ChangeLog
Tools/WebKitTestRunner/TestController.cpp
Tools/WebKitTestRunner/TestController.h
Tools/WebKitTestRunner/TestOptions.h
Tools/WebKitTestRunner/cocoa/TestControllerCocoa.mm