Title: [128278] trunk
Revision
128278
Author
commit-qu...@webkit.org
Date
2012-09-12 02:10:06 -0700 (Wed, 12 Sep 2012)

Log Message

[WK2] [WTR] WebKitTestRunner needs TestRunner.workerThreadCount
https://bugs.webkit.org/show_bug.cgi?id=96388

Patch by Mikhail Pozdnyakov <mikhail.pozdnya...@intel.com> on 2012-09-12
Reviewed by Kenneth Rohde Christiansen.

Source/WebKit2:

Added WKBundleGetWorkerThreadCount() function to Injected Bundle private API.

* WebProcess/InjectedBundle/API/c/WKBundle.cpp:
(WKBundleGetWorkerThreadCount):
* WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::workerThreadCount): Returns count of worker threads.
(WebKit):
* WebProcess/InjectedBundle/InjectedBundle.h:
(InjectedBundle):

Tools:

Exported TestRunner.workerThreadCount as readonly attribute.

* WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
* WebKitTestRunner/InjectedBundle/TestRunner.cpp: Added workerThreadCount() method implementation.
(WTR::TestRunner::workerThreadCount): Returns count of worker threads.
(WTR):
* WebKitTestRunner/InjectedBundle/TestRunner.h: Added workerThreadCount() method.
(TestRunner):

LayoutTests:

Unskipped corresponding tests.

* platform/wk2/Skipped:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (128277 => 128278)


--- trunk/LayoutTests/ChangeLog	2012-09-12 08:54:00 UTC (rev 128277)
+++ trunk/LayoutTests/ChangeLog	2012-09-12 09:10:06 UTC (rev 128278)
@@ -1,3 +1,14 @@
+2012-09-12  Mikhail Pozdnyakov  <mikhail.pozdnya...@intel.com>
+
+        [WK2] [WTR] WebKitTestRunner needs TestRunner.workerThreadCount
+        https://bugs.webkit.org/show_bug.cgi?id=96388
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Unskipped corresponding tests.
+
+        * platform/wk2/Skipped:
+
 2012-09-12  Jochen Eisinger  <joc...@chromium.org>
 
         [chromium] Only allow one user-gesture gated action per user action.

Modified: trunk/LayoutTests/platform/wk2/Skipped (128277 => 128278)


--- trunk/LayoutTests/platform/wk2/Skipped	2012-09-12 08:54:00 UTC (rev 128277)
+++ trunk/LayoutTests/platform/wk2/Skipped	2012-09-12 09:10:06 UTC (rev 128278)
@@ -673,13 +673,6 @@
 # WebKitTestRunner should dump text/plain content as text
 http/tests/incremental/slow-utf8-text.pl
 
-# WebKitTestRunner needs layoutTestController.workerThreadCount
-fast/workers/dedicated-worker-lifecycle.html
-fast/workers/shared-worker-frame-lifecycle.html
-fast/workers/shared-worker-lifecycle.html
-fast/workers/worker-lifecycle.html
-fast/workers/worker-close-more.html
-
 # WebKitTestRunner needs layoutTestController.callShouldCloseOnWebView
 fast/events/onbeforeunload-focused-iframe.html
 

Modified: trunk/Source/WebKit2/ChangeLog (128277 => 128278)


--- trunk/Source/WebKit2/ChangeLog	2012-09-12 08:54:00 UTC (rev 128277)
+++ trunk/Source/WebKit2/ChangeLog	2012-09-12 09:10:06 UTC (rev 128278)
@@ -1,3 +1,21 @@
+2012-09-12  Mikhail Pozdnyakov  <mikhail.pozdnya...@intel.com>
+
+        [WK2] [WTR] WebKitTestRunner needs TestRunner.workerThreadCount
+        https://bugs.webkit.org/show_bug.cgi?id=96388
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Added WKBundleGetWorkerThreadCount() function to Injected Bundle private API.
+
+        * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
+        (WKBundleGetWorkerThreadCount):
+        * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
+        * WebProcess/InjectedBundle/InjectedBundle.cpp:
+        (WebKit::InjectedBundle::workerThreadCount): Returns count of worker threads.
+        (WebKit):
+        * WebProcess/InjectedBundle/InjectedBundle.h:
+        (InjectedBundle):
+
 2012-09-12  Darin Adler  <da...@apple.com>
 
         Make NetscapePlugin::m_timers use HashMap<OwnPtr> instead of deleteAllValues

Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundle.cpp (128277 => 128278)


--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundle.cpp	2012-09-12 08:54:00 UTC (rev 128277)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundle.cpp	2012-09-12 09:10:06 UTC (rev 128278)
@@ -286,6 +286,12 @@
     toImpl(bundleRef)->setPageVisibilityState(toImpl(pageRef), state, isInitialState);
 }
 
+size_t WKBundleGetWorkerThreadCount(WKBundleRef)
+{
+    // Actually do not need argument here, keeping it however for consistency.
+    return InjectedBundle::workerThreadCount();
+}
+
 void WKBundleSetUserStyleSheetLocation(WKBundleRef bundleRef, WKBundlePageGroupRef pageGroupRef, WKStringRef location)
 {
     toImpl(bundleRef)->setUserStyleSheetLocation(toImpl(pageGroupRef), toImpl(location)->string());

Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePrivate.h (128277 => 128278)


--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePrivate.h	2012-09-12 08:54:00 UTC (rev 128277)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePrivate.h	2012-09-12 09:10:06 UTC (rev 128278)
@@ -109,6 +109,8 @@
 
 WK_EXPORT void WKBundleSetPageVisibilityState(WKBundleRef bundle, WKBundlePageRef page, int state, bool isInitialState);
 
+WK_EXPORT size_t WKBundleGetWorkerThreadCount(WKBundleRef bundle);
+
 #ifdef __cplusplus
 }
 #endif

Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp (128277 => 128278)


--- trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp	2012-09-12 08:54:00 UTC (rev 128277)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp	2012-09-12 09:10:06 UTC (rev 128278)
@@ -67,6 +67,7 @@
 #include <WebCore/SecurityPolicy.h>
 #include <WebCore/Settings.h>
 #include <WebCore/UserGestureIndicator.h>
+#include <WebCore/WorkerThread.h>
 #include <wtf/OwnArrayPtr.h>
 #include <wtf/PassOwnArrayPtr.h>
 
@@ -570,6 +571,15 @@
 #endif
 }
 
+size_t InjectedBundle::workerThreadCount()
+{
+#if ENABLE(WORKERS)
+    return WebCore::WorkerThread::workerThreadCount();
+#else
+    return 0;
+#endif
+}
+
 void InjectedBundle::setUserStyleSheetLocation(WebPageGroupProxy* pageGroup, const String& location)
 {
     const HashSet<Page*>& pages = PageGroup::pageGroup(pageGroup->identifier())->pages();

Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.h (128277 => 128278)


--- trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.h	2012-09-12 08:54:00 UTC (rev 128277)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.h	2012-09-12 09:10:06 UTC (rev 128278)
@@ -171,6 +171,8 @@
 
     void setPageVisibilityState(WebPage*, int state, bool isInitialState);
 
+    static size_t workerThreadCount();
+
 private:
     explicit InjectedBundle(const String&);
 

Modified: trunk/Tools/ChangeLog (128277 => 128278)


--- trunk/Tools/ChangeLog	2012-09-12 08:54:00 UTC (rev 128277)
+++ trunk/Tools/ChangeLog	2012-09-12 09:10:06 UTC (rev 128278)
@@ -1,3 +1,19 @@
+2012-09-12  Mikhail Pozdnyakov  <mikhail.pozdnya...@intel.com>
+
+        [WK2] [WTR] WebKitTestRunner needs TestRunner.workerThreadCount
+        https://bugs.webkit.org/show_bug.cgi?id=96388
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Exported TestRunner.workerThreadCount as readonly attribute.
+
+        * WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
+        * WebKitTestRunner/InjectedBundle/TestRunner.cpp: Added workerThreadCount() method implementation.
+        (WTR::TestRunner::workerThreadCount): Returns count of worker threads.
+        (WTR):
+        * WebKitTestRunner/InjectedBundle/TestRunner.h: Added workerThreadCount() method. 
+        (TestRunner):
+
 2012-09-12  Jochen Eisinger  <joc...@chromium.org>
 
         [chromium] Consume a user gesture when creating a new view.

Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl (128277 => 128278)


--- trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl	2012-09-12 08:54:00 UTC (rev 128277)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl	2012-09-12 09:10:06 UTC (rev 128278)
@@ -80,6 +80,7 @@
 
         // Special DOM variables.
         attribute boolean globalFlag;
+        readonly attribute unsigned long workerThreadCount;
 
         // Repaint testing.
         void testRepaint();

Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp (128277 => 128278)


--- trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp	2012-09-12 08:54:00 UTC (rev 128277)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp	2012-09-12 09:10:06 UTC (rev 128278)
@@ -567,6 +567,11 @@
     JSValueUnprotect(context, callback);
 }
 
+unsigned TestRunner::workerThreadCount()
+{
+    return WKBundleGetWorkerThreadCount(InjectedBundle::shared().bundle());
+}
+
 void TestRunner::addChromeInputField(JSValueRef callback)
 {
     cacheTestRunnerCallback(AddChromeInputFieldCallbackID, callback);

Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h (128277 => 128278)


--- trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h	2012-09-12 08:54:00 UTC (rev 128277)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h	2012-09-12 09:10:06 UTC (rev 128278)
@@ -203,6 +203,8 @@
     
     bool globalFlag() const { return m_globalFlag; }
     void setGlobalFlag(bool value) { m_globalFlag = value; }
+
+    unsigned workerThreadCount();
     
     void addChromeInputField(JSValueRef);
     void removeChromeInputField(JSValueRef);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to