TestWebKitAPI: initialize the main thread before running tests
authorddkilzer@apple.com <ddkilzer@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 22 Dec 2011 16:41:07 +0000 (16:41 +0000)
committerddkilzer@apple.com <ddkilzer@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 22 Dec 2011 16:41:07 +0000 (16:41 +0000)
<http://webkit.org/b/75064>

Reviewed by Adam Roben.

* TestWebKitAPI/TestsController.cpp:
(TestWebKitAPI::TestsController::TestsController): Call
WTF::initializeMainThread() to prevent assertions in Debug
builds.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@103546 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Tools/ChangeLog
Tools/TestWebKitAPI/TestsController.cpp

index 3f37ca6..d94dbcf 100644 (file)
@@ -1,5 +1,17 @@
 2011-12-22  David Kilzer  <ddkilzer@apple.com>
 
+        TestWebKitAPI: initialize the main thread before running tests
+        <http://webkit.org/b/75064>
+
+        Reviewed by Adam Roben.
+
+        * TestWebKitAPI/TestsController.cpp:
+        (TestWebKitAPI::TestsController::TestsController): Call
+        WTF::initializeMainThread() to prevent assertions in Debug
+        builds.
+
+2011-12-22  David Kilzer  <ddkilzer@apple.com>
+
         run-api-tests: dumpAllTests() should not use global variables
 
         Reviewed by Adam Roben.
index 29dcc71..955838f 100644 (file)
@@ -26,6 +26,7 @@
 #include "config.h"
 #include "TestsController.h"
 
+#include <wtf/MainThread.h>
 #include <wtf/Threading.h>
 
 namespace TestWebKitAPI {
@@ -38,6 +39,8 @@ TestsController& TestsController::shared()
 
 TestsController::TestsController()
 {
+    WTF::initializeMainThread();
+
     // FIXME: We currently initialize threading here to avoid assertion failures from
     // the ThreadRestrictionVerifier - https://bugs.webkit.org/show_bug.cgi?id=66112
     // We should make sure that all objects tested either initialize threading or inherit from