WebKit Bugzilla
Attachment 357683 Details for
Bug 192855
: [GTK][WPE] Unify TestController::platformRunUntil() and honor condition flag
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-192855-20181219185656.patch (text/plain), 4.25 KB, created by
Adrian Perez
on 2018-12-19 08:56:57 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Adrian Perez
Created:
2018-12-19 08:56:57 PST
Size:
4.25 KB
patch
obsolete
>Subversion Revision: 239378 >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index 1b01b1da638e62107d84808ddd839e688b9d4569..a16c1c458179f0a2fad6b81676b3b679a22a64fa 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,16 @@ >+2018-12-19 Adrian Perez de Castro <aperez@igalia.com> >+ >+ [GTK][WPE] Unify TestController::platformRunUntil() and honor condition flag >+ https://bugs.webkit.org/show_bug.cgi?id=192855 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * WebKitTestRunner/gtk/TestControllerGtk.cpp: >+ (WTR::TestController::notifyDone): Use the WPE implementation. >+ (WTR::TestController::platformRunUntil): Use the WPE implementation. >+ * WebKitTestRunner/wpe/TestControllerWPE.cpp: >+ (WTR::TestController::platformRunUntil): Honor the condition flag. >+ > 2018-12-18 Wenson Hsieh <wenson_hsieh@apple.com> > > [iOS] A copied text selection is pasted as a web archive attachment in the entry view in Messages >diff --git a/Tools/WebKitTestRunner/gtk/TestControllerGtk.cpp b/Tools/WebKitTestRunner/gtk/TestControllerGtk.cpp >index 4f2e8c43a53b0fd98103152990254bd4ee68c352..38f93ee4f94a7b94788480e22b0c4f8c4a26069c 100644 >--- a/Tools/WebKitTestRunner/gtk/TestControllerGtk.cpp >+++ b/Tools/WebKitTestRunner/gtk/TestControllerGtk.cpp >@@ -37,27 +37,8 @@ > > namespace WTR { > >-static GSource* timeoutSource() >-{ >- static GRefPtr<GSource> source = nullptr; >- if (!source) { >- source = adoptGRef(g_timeout_source_new(0)); >- g_source_set_ready_time(source.get(), -1); >- g_source_set_name(source.get(), "[WTR] Test timeout source"); >- g_source_set_callback(source.get(), [](gpointer userData) -> gboolean { >- g_source_set_ready_time(static_cast<GSource*>(userData), -1); >- fprintf(stderr, "FAIL: TestControllerRunLoop timed out.\n"); >- RunLoop::main().stop(); >- return G_SOURCE_REMOVE; >- }, source.get(), nullptr); >- g_source_attach(source.get(), nullptr); >- } >- return source.get(); >-} >- > void TestController::notifyDone() > { >- g_source_set_ready_time(timeoutSource(), -1); > RunLoop::main().stop(); > } > >@@ -74,17 +55,25 @@ void TestController::platformDestroy() > { > } > >-void TestController::platformRunUntil(bool&, WTF::Seconds timeout) >+void TestController::platformRunUntil(bool& done, WTF::Seconds timeout) > { >- if (timeout > 0_s) { >- // FIXME: This conversion is now repeated in several places, it should be moved to a common place in WTF and used everywhere. >- gint64 currentTime = g_get_monotonic_time(); >- gint64 targetTime = currentTime + std::min<gint64>(G_MAXINT64 - currentTime, timeout.microsecondsAs<int64_t>()); >- ASSERT(targetTime >= currentTime); >- g_source_set_ready_time(timeoutSource(), targetTime); >- } else >- g_source_set_ready_time(timeoutSource(), -1); >- RunLoop::main().run(); >+ struct TimeoutTimer { >+ TimeoutTimer() >+ : timer(RunLoop::main(), this, &TimeoutTimer::fired) >+ { } >+ >+ void fired() { RunLoop::main().stop(); } >+ RunLoop::Timer<TimeoutTimer> timer; >+ } timeoutTimer; >+ >+ timeoutTimer.timer.setPriority(G_PRIORITY_DEFAULT_IDLE); >+ if (timeout >= 0_s) >+ timeoutTimer.timer.startOneShot(timeout); >+ >+ while (!done) >+ RunLoop::main().run(); >+ >+ timeoutTimer.timer.stop(); > } > > static char* getEnvironmentVariableAsUTF8String(const char* variableName) >diff --git a/Tools/WebKitTestRunner/wpe/TestControllerWPE.cpp b/Tools/WebKitTestRunner/wpe/TestControllerWPE.cpp >index fe30d3de8552575a86fee6a4587b45354b18ed5c..4b572b6b13ea68252a61a032e731f7cd9acbf726 100644 >--- a/Tools/WebKitTestRunner/wpe/TestControllerWPE.cpp >+++ b/Tools/WebKitTestRunner/wpe/TestControllerWPE.cpp >@@ -58,7 +58,7 @@ void TestController::platformInitializeContext() > { > } > >-void TestController::platformRunUntil(bool& condition, WTF::Seconds timeout) >+void TestController::platformRunUntil(bool& done, WTF::Seconds timeout) > { > struct TimeoutTimer { > TimeoutTimer() >@@ -73,7 +73,8 @@ void TestController::platformRunUntil(bool& condition, WTF::Seconds timeout) > if (timeout >= 0_s) > timeoutTimer.timer.startOneShot(timeout); > >- RunLoop::main().run(); >+ while (!done) >+ RunLoop::main().run(); > > timeoutTimer.timer.stop(); > }
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 192855
:
357683
|
357712
|
357737