WebKit Bugzilla
Attachment 348878 Details for
Bug 189287
: Add generic entrypoint and run loop in TestWebKitAPI
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-189287.diff (text/plain), 5.98 KB, created by
Don Olmstead
on 2018-09-04 17:57:05 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Don Olmstead
Created:
2018-09-04 17:57:05 PDT
Size:
5.98 KB
patch
obsolete
>diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index c063356bdb9..e4bc9474960 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,32 @@ >+2018-09-04 Don Olmstead <don.olmstead@sony.com> >+ >+ Add generic entrypoint and run loop in TestWebKitAPI >+ https://bugs.webkit.org/show_bug.cgi?id=189287 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ The implementations in jsconly are platform agnostic. >+ >+ * TestWebKitAPI/PlatformJSCOnly.cmake: >+ Use the glib implementation of Utilities when using that as a run loop >+ otherwise use the generic implementation. >+ >+ * TestWebKitAPI/PlatformUtilities.h: >+ Remove repeated entries from Utilities.h. >+ >+ * TestWebKitAPI/PlatformWPE.cmake: >+ Use the generic main.cpp. >+ >+ * TestWebKitAPI/generic/UtilitiesGeneric.cpp: Renamed from Tools/TestWebKitAPI/jsconly/PlatformUtilitiesJSCOnly.cpp. >+ (TestWebKitAPI::Util::run): >+ (TestWebKitAPI::Util::spinRunLoop): >+ Moved to a generic implementation and added spinRunLoop. >+ >+ * TestWebKitAPI/generic/main.cpp: Renamed from Tools/TestWebKitAPI/jsconly/main.cpp. >+ Share between JSCOnly and WPE >+ >+ * TestWebKitAPI/wpe/main.cpp: Removed. >+ > 2018-09-04 Keith Miller <keith_miller@apple.com> > > Perl doesn't like calling keys on a reference >diff --git a/Tools/TestWebKitAPI/PlatformJSCOnly.cmake b/Tools/TestWebKitAPI/PlatformJSCOnly.cmake >index 7e53f86e298..a3fa2da955d 100644 >--- a/Tools/TestWebKitAPI/PlatformJSCOnly.cmake >+++ b/Tools/TestWebKitAPI/PlatformJSCOnly.cmake >@@ -9,13 +9,19 @@ if (LOWERCASE_EVENT_LOOP_TYPE STREQUAL "glib") > include_directories(SYSTEM > ${GLIB_INCLUDE_DIRS} > ) >+ list(APPEND TestWTF_SOURCES >+ ${TESTWEBKITAPI_DIR}/glib/UtilitiesGLib.cpp >+ ) >+else () >+ list(APPEND TestWTF_SOURCES >+ ${TESTWEBKITAPI_DIR}/generic/UtilitiesGeneric.cpp >+ ) > endif () > > set(test_main_SOURCES >- ${TESTWEBKITAPI_DIR}/jsconly/main.cpp >+ ${TESTWEBKITAPI_DIR}/generic/main.cpp > ) > > list(APPEND TestWTF_SOURCES >- ${TESTWEBKITAPI_DIR}/jsconly/PlatformUtilitiesJSCOnly.cpp > ${TESTWEBKITAPI_DIR}/Tests/WTF/RunLoop.cpp > ) >diff --git a/Tools/TestWebKitAPI/PlatformUtilities.h b/Tools/TestWebKitAPI/PlatformUtilities.h >index e1e309e6931..f5555fd9d08 100644 >--- a/Tools/TestWebKitAPI/PlatformUtilities.h >+++ b/Tools/TestWebKitAPI/PlatformUtilities.h >@@ -42,10 +42,6 @@ OBJC_CLASS NSDictionary; > namespace TestWebKitAPI { > namespace Util { > >-// Runs a platform runloop until the 'done' is true. >-void run(bool* done); >-void sleep(double seconds); >- > std::string toSTD(const char*); > #if USE(FOUNDATION) > std::string toSTD(NSString *); >diff --git a/Tools/TestWebKitAPI/PlatformWPE.cmake b/Tools/TestWebKitAPI/PlatformWPE.cmake >index 7457c75e1af..06d2c98b4bf 100644 >--- a/Tools/TestWebKitAPI/PlatformWPE.cmake >+++ b/Tools/TestWebKitAPI/PlatformWPE.cmake >@@ -29,7 +29,7 @@ include_directories(SYSTEM > ) > > set(test_main_SOURCES >- ${TESTWEBKITAPI_DIR}/wpe/main.cpp >+ ${TESTWEBKITAPI_DIR}/generic/main.cpp > ) > > set(bundle_harness_SOURCES >diff --git a/Tools/TestWebKitAPI/jsconly/PlatformUtilitiesJSCOnly.cpp b/Tools/TestWebKitAPI/generic/UtilitiesGeneric.cpp >similarity index 87% >rename from Tools/TestWebKitAPI/jsconly/PlatformUtilitiesJSCOnly.cpp >rename to Tools/TestWebKitAPI/generic/UtilitiesGeneric.cpp >index cd3ec02eb44..a83dd63aa29 100644 >--- a/Tools/TestWebKitAPI/jsconly/PlatformUtilitiesJSCOnly.cpp >+++ b/Tools/TestWebKitAPI/generic/UtilitiesGeneric.cpp >@@ -24,26 +24,25 @@ > */ > > #include "config.h" >-#include "PlatformUtilities.h" >+#include "Utilities.h" > > #include <wtf/RunLoop.h> > >-#if USE(GLIB_EVENT_LOOP) >-#include <glib.h> >-#include <wtf/glib/GRefPtr.h> >-#endif >- > namespace TestWebKitAPI { > namespace Util { > > void run(bool* done) > { > while (!*done) { >-#if USE(GLIB_EVENT_LOOP) >- g_main_context_iteration(RunLoop::current().mainContext(), false); >-#else > WTF::RunLoop::iterate(); >-#endif >+ } >+} >+ >+void spinRunLoop(uint64_t count) >+{ >+ while (count > 0) { >+ WTF::RunLoop::current().iterate(); >+ count--; > } > } > >diff --git a/Tools/TestWebKitAPI/jsconly/main.cpp b/Tools/TestWebKitAPI/generic/main.cpp >similarity index 100% >rename from Tools/TestWebKitAPI/jsconly/main.cpp >rename to Tools/TestWebKitAPI/generic/main.cpp >diff --git a/Tools/TestWebKitAPI/wpe/main.cpp b/Tools/TestWebKitAPI/wpe/main.cpp >deleted file mode 100644 >index f6568b6c32d..00000000000 >--- a/Tools/TestWebKitAPI/wpe/main.cpp >+++ /dev/null >@@ -1,32 +0,0 @@ >-/* >- * Copyright (C) 2016 Igalia S.L. >- * >- * Redistribution and use in source and binary forms, with or without >- * modification, are permitted provided that the following conditions >- * are met: >- * 1. Redistributions of source code must retain the above copyright >- * notice, this list of conditions and the following disclaimer. >- * 2. Redistributions in binary form must reproduce the above copyright >- * notice, this list of conditions and the following disclaimer in the >- * documentation and/or other materials provided with the distribution. >- * >- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >- * THE POSSIBILITY OF SUCH DAMAGE. >- */ >- >-#include "config.h" >-#include "TestsController.h" >- >-int main(int argc, char** argv) >-{ >- return TestWebKitAPI::TestsController::singleton().run(argc, argv) ? EXIT_SUCCESS : EXIT_FAILURE; >-}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 189287
:
348878
|
348880