Title: [252228] trunk
Revision
252228
Author
cdu...@apple.com
Date
2019-11-07 18:45:05 -0800 (Thu, 07 Nov 2019)

Log Message

TestController may reuse a view that used window.open(), which prevents process-swapping and causes flakiness
https://bugs.webkit.org/show_bug.cgi?id=203981

Reviewed by Ryosuke Niwa.

Tools:

Stop reusing WebViews that have created other WebViews (via window.open()) since this prevents process-swapping
and may therefore cause flakiness (see Bug 203965).

* WebKitTestRunner/TestController.cpp:
(WTR::TestController::createOtherPage):
(WTR::TestController::ensureViewSupportsOptionsForTest):
* WebKitTestRunner/TestController.h:

LayoutTests:

Drop temporary flakiness workaround that was landed in r252214.

* http/tests/inspector/target/target-events-for-provisional-page.html:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (252227 => 252228)


--- trunk/LayoutTests/ChangeLog	2019-11-08 02:35:32 UTC (rev 252227)
+++ trunk/LayoutTests/ChangeLog	2019-11-08 02:45:05 UTC (rev 252228)
@@ -1,3 +1,14 @@
+2019-11-07  Chris Dumez  <cdu...@apple.com>
+
+        TestController may reuse a view that used window.open(), which prevents process-swapping and causes flakiness
+        https://bugs.webkit.org/show_bug.cgi?id=203981
+
+        Reviewed by Ryosuke Niwa.
+
+        Drop temporary flakiness workaround that was landed in r252214.
+
+        * http/tests/inspector/target/target-events-for-provisional-page.html:
+
 2019-11-07  Justin Fan  <justin_...@apple.com>
 
         [WebGL] Fixing WebGL tests: Add new baselines for iOS bots

Modified: trunk/LayoutTests/http/tests/inspector/target/target-events-for-provisional-page.html (252227 => 252228)


--- trunk/LayoutTests/http/tests/inspector/target/target-events-for-provisional-page.html	2019-11-08 02:35:32 UTC (rev 252227)
+++ trunk/LayoutTests/http/tests/inspector/target/target-events-for-provisional-page.html	2019-11-08 02:45:05 UTC (rev 252228)
@@ -1,4 +1,4 @@
-<!DOCTYPE html><!-- webkit-test-runner [ enableProcessSwapOnWindowOpen=true ] -->
+<!DOCTYPE html>
 <html>
 <head>
 <meta charset="utf-8">

Modified: trunk/LayoutTests/platform/wk2/http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-script-in-iframe-expected.txt (252227 => 252228)


--- trunk/LayoutTests/platform/wk2/http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-script-in-iframe-expected.txt	2019-11-08 02:35:32 UTC (rev 252227)
+++ trunk/LayoutTests/platform/wk2/http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-script-in-iframe-expected.txt	2019-11-08 02:45:05 UTC (rev 252228)
@@ -2,6 +2,7 @@
 frame "<!--frame1-->" - didStartProvisionalLoadForFrame
 frame "<!--frame1-->" - didCommitLoadForFrame
 CONSOLE MESSAGE: Blocked mixed content http://127.0.0.1:8000/security/mixedContent/resources/script.js because 'block-all-mixed-content' appears in the Content Security Policy.
+CONSOLE MESSAGE: Blocked mixed content http://127.0.0.1:8000/security/mixedContent/resources/script.js because 'block-all-mixed-content' appears in the Content Security Policy.
 frame "<!--frame1-->" - didFinishDocumentLoadForFrame
 frame "<!--frame1-->" - didHandleOnloadEventsForFrame
 main frame - didHandleOnloadEventsForFrame

Modified: trunk/Tools/ChangeLog (252227 => 252228)


--- trunk/Tools/ChangeLog	2019-11-08 02:35:32 UTC (rev 252227)
+++ trunk/Tools/ChangeLog	2019-11-08 02:45:05 UTC (rev 252228)
@@ -1,3 +1,18 @@
+2019-11-07  Chris Dumez  <cdu...@apple.com>
+
+        TestController may reuse a view that used window.open(), which prevents process-swapping and causes flakiness
+        https://bugs.webkit.org/show_bug.cgi?id=203981
+
+        Reviewed by Ryosuke Niwa.
+
+        Stop reusing WebViews that have created other WebViews (via window.open()) since this prevents process-swapping
+        and may therefore cause flakiness (see Bug 203965).
+
+        * WebKitTestRunner/TestController.cpp:
+        (WTR::TestController::createOtherPage):
+        (WTR::TestController::ensureViewSupportsOptionsForTest):
+        * WebKitTestRunner/TestController.h:
+
 2019-11-07  Aakash Jain  <aakash_j...@apple.com>
 
         [ews] rename RunJavaScriptCoreTestsToT to RunJSCTestsWithoutPatch

Modified: trunk/Tools/WebKitTestRunner/TestController.cpp (252227 => 252228)


--- trunk/Tools/WebKitTestRunner/TestController.cpp	2019-11-08 02:35:32 UTC (rev 252227)
+++ trunk/Tools/WebKitTestRunner/TestController.cpp	2019-11-08 02:45:05 UTC (rev 252228)
@@ -314,6 +314,8 @@
     if (!m_currentInvocation->canOpenWindows())
         return nullptr;
 
+    m_createdOtherPage = true;
+
     PlatformWebView* view = platformCreateOtherPage(parentView, configuration, parentView->options());
     WKPageRef newPage = view->page();
 
@@ -767,7 +769,9 @@
     auto options = test.options();
 
     if (m_mainWebView) {
-        if (m_mainWebView->viewSupportsOptions(options))
+        // Having created another page (via window.open()) prevents process swapping on navigation and it may therefore
+        // cause flakiness to reuse the view.
+        if (!m_createdOtherPage && m_mainWebView->viewSupportsOptions(options))
             return;
 
         willDestroyWebView();
@@ -777,6 +781,7 @@
         WKPageClose(m_mainWebView->page());
 
         m_mainWebView = nullptr;
+        m_createdOtherPage = false;
     }
 
     createWebViewWithOptions(options);

Modified: trunk/Tools/WebKitTestRunner/TestController.h (252227 => 252228)


--- trunk/Tools/WebKitTestRunner/TestController.h	2019-11-08 02:35:32 UTC (rev 252227)
+++ trunk/Tools/WebKitTestRunner/TestController.h	2019-11-08 02:45:05 UTC (rev 252228)
@@ -496,6 +496,7 @@
     bool m_usingServerMode { false };
     bool m_gcBetweenTests { false };
     bool m_shouldDumpPixelsForAllTests { false };
+    bool m_createdOtherPage { false };
     std::vector<std::string> m_paths;
     std::set<std::string> m_allowedHosts;
     WKRetainPtr<WKStringRef> m_injectedBundlePath;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to