Title: [187627] trunk/Source/WebKit2
Revision
187627
Author
commit-qu...@webkit.org
Date
2015-07-30 17:17:28 -0700 (Thu, 30 Jul 2015)

Log Message

LayoutTests/inspector frequently run slow and timeout when run in WebKit2 but not WebKit1
https://bugs.webkit.org/show_bug.cgi?id=147456

Patch by Joseph Pecoraro <pecor...@apple.com> on 2015-07-30
Reviewed by Timothy Hatcher.

By default, WebKit2 WebPage's on PLATFORM(COCOA) enabling DOM Timer
throttling. Under testing, this ends up impacting Web Inspector
tests that create their own WKWebView which never gets displayed
and so gets throttled. Disable throttling on the Inspector's view
during testing.

* UIProcess/API/Cocoa/WKPreferencesPrivate.h:
* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences _hiddenPageDOMTimerThrottlingEnabled]):
(-[WKPreferences _setHiddenPageDOMTimerThrottlingEnabled:]):
SPI to toggle DOM timer throttling.

* UIProcess/WebInspectorProxy.cpp:
(WebKit::WebInspectorProxy::createInspectorPage):
* UIProcess/WebInspectorProxy.h:
(WebKit::WebInspectorProxy::isUnderTest):
Provide a way to get if we are under test, and set it before
calling into the platform method.

* UIProcess/mac/WebInspectorProxyMac.mm:
(WebKit::WebInspectorProxy::platformCreateInspectorPage):
When testing, disable timer throttling.

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (187626 => 187627)


--- trunk/Source/WebKit2/ChangeLog	2015-07-31 00:12:38 UTC (rev 187626)
+++ trunk/Source/WebKit2/ChangeLog	2015-07-31 00:17:28 UTC (rev 187627)
@@ -1,3 +1,33 @@
+2015-07-30  Joseph Pecoraro  <pecor...@apple.com>
+
+        LayoutTests/inspector frequently run slow and timeout when run in WebKit2 but not WebKit1
+        https://bugs.webkit.org/show_bug.cgi?id=147456
+
+        Reviewed by Timothy Hatcher.
+
+        By default, WebKit2 WebPage's on PLATFORM(COCOA) enabling DOM Timer
+        throttling. Under testing, this ends up impacting Web Inspector
+        tests that create their own WKWebView which never gets displayed
+        and so gets throttled. Disable throttling on the Inspector's view
+        during testing.
+
+        * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
+        * UIProcess/API/Cocoa/WKPreferences.mm:
+        (-[WKPreferences _hiddenPageDOMTimerThrottlingEnabled]):
+        (-[WKPreferences _setHiddenPageDOMTimerThrottlingEnabled:]):
+        SPI to toggle DOM timer throttling.
+
+        * UIProcess/WebInspectorProxy.cpp:
+        (WebKit::WebInspectorProxy::createInspectorPage):
+        * UIProcess/WebInspectorProxy.h:
+        (WebKit::WebInspectorProxy::isUnderTest):
+        Provide a way to get if we are under test, and set it before
+        calling into the platform method.
+
+        * UIProcess/mac/WebInspectorProxyMac.mm:
+        (WebKit::WebInspectorProxy::platformCreateInspectorPage):
+        When testing, disable timer throttling.
+
 2015-07-30  Eric Carlson  <eric.carl...@apple.com>
 
         [iOS] Set AirPlay discovery mode to disabled when page is hidden

Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKPreferences.mm (187626 => 187627)


--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKPreferences.mm	2015-07-31 00:12:38 UTC (rev 187626)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKPreferences.mm	2015-07-31 00:17:28 UTC (rev 187627)
@@ -257,6 +257,16 @@
     _preferences->setLogsPageMessagesToSystemConsoleEnabled(logsPageMessagesToSystemConsoleEnabled);
 }
 
+- (BOOL)_hiddenPageDOMTimerThrottlingEnabled
+{
+    return _preferences->hiddenPageDOMTimerThrottlingEnabled();
+}
+
+- (void)_setHiddenPageDOMTimerThrottlingEnabled:(BOOL)hiddenPageDOMTimerRhrottlingEnabled
+{
+    _preferences->setHiddenPageDOMTimerThrottlingEnabled(hiddenPageDOMTimerRhrottlingEnabled);
+}
+
 - (BOOL)_allowFileAccessFromFileURLs
 {
     return _preferences->allowFileAccessFromFileURLs();

Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKPreferencesPrivate.h (187626 => 187627)


--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKPreferencesPrivate.h	2015-07-31 00:12:38 UTC (rev 187626)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKPreferencesPrivate.h	2015-07-31 00:17:28 UTC (rev 187627)
@@ -62,6 +62,8 @@
 
 @property (nonatomic, setter=_setLogsPageMessagesToSystemConsoleEnabled:) BOOL _logsPageMessagesToSystemConsoleEnabled WK_AVAILABLE(WK_MAC_TBA, WK_IOS_TBA);
 
+@property (nonatomic, setter=_setHiddenPageDOMTimerThrottlingEnabled:) BOOL _hiddenPageDOMTimerThrottlingEnabled WK_AVAILABLE(WK_MAC_TBA, WK_IOS_TBA);
+
 @property (nonatomic, setter=_setAllowFileAccessFromFileURLs:) BOOL _allowFileAccessFromFileURLs WK_AVAILABLE(WK_MAC_TBA, WK_IOS_TBA);
 @property (nonatomic, setter=_setJavaScriptRuntimeFlags:) _WKJavaScriptRuntimeFlags _javaScriptRuntimeFlags WK_AVAILABLE(WK_MAC_TBA, WK_IOS_TBA);
 

Modified: trunk/Source/WebKit2/UIProcess/WebInspectorProxy.cpp (187626 => 187627)


--- trunk/Source/WebKit2/UIProcess/WebInspectorProxy.cpp	2015-07-31 00:12:38 UTC (rev 187626)
+++ trunk/Source/WebKit2/UIProcess/WebInspectorProxy.cpp	2015-07-31 00:17:28 UTC (rev 187627)
@@ -484,13 +484,13 @@
     if (!m_inspectedPage)
         return;
 
+    m_underTest = underTest;
     eagerlyCreateInspectorPage();
 
     ASSERT(m_inspectorPage);
     if (!m_inspectorPage)
         return;
 
-    m_underTest = underTest;
     m_connectionIdentifier = WTF::move(connectionIdentifier);
 
     m_inspectorPage->process().send(Messages::WebInspectorUI::EstablishConnection(m_connectionIdentifier, m_inspectedPage->pageID(), m_underTest), m_inspectorPage->pageID());

Modified: trunk/Source/WebKit2/UIProcess/WebInspectorProxy.h (187626 => 187627)


--- trunk/Source/WebKit2/UIProcess/WebInspectorProxy.h	2015-07-31 00:12:38 UTC (rev 187626)
+++ trunk/Source/WebKit2/UIProcess/WebInspectorProxy.h	2015-07-31 00:17:28 UTC (rev 187627)
@@ -206,6 +206,8 @@
     bool canAttach() const { return m_canAttach; }
     bool shouldOpenAttached();
 
+    bool isUnderTest() const { return m_underTest; }
+
     void open();
 
     // The inspector level is used to give different preferences to each inspector

Modified: trunk/Source/WebKit2/UIProcess/mac/WebInspectorProxyMac.mm (187626 => 187627)


--- trunk/Source/WebKit2/UIProcess/mac/WebInspectorProxyMac.mm	2015-07-31 00:12:38 UTC (rev 187626)
+++ trunk/Source/WebKit2/UIProcess/mac/WebInspectorProxyMac.mm	2015-07-31 00:17:28 UTC (rev 187627)
@@ -420,6 +420,9 @@
 #endif
     preferences._allowFileAccessFromFileURLs = YES;
     preferences._javaScriptRuntimeFlags = 0;
+    if (isUnderTest())
+        preferences._hiddenPageDOMTimerThrottlingEnabled = NO;
+
     [configuration setProcessPool: ::WebKit::wrapper(inspectorProcessPool())];
     [configuration _setGroupIdentifier:inspectorPageGroupIdentifier()];
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to