WebKit Bugzilla
Attachment 348158 Details for
Bug 188987
: Convert timeout values in WebKitTestRunner to WTF::Seconds
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-188987-20180827103451.patch (text/plain), 22.27 KB, created by
Simon Fraser (smfr)
on 2018-08-27 10:34:52 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Simon Fraser (smfr)
Created:
2018-08-27 10:34:52 PDT
Size:
22.27 KB
patch
obsolete
>Subversion Revision: 235338 >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index 9998e3c2ccac6907ff9a4a3985c6c58ee8c46fd9..1d4830e8aa64fc2afda3afb0a943395991f652a4 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,50 @@ >+2018-08-27 Simon Fraser <simon.fraser@apple.com> >+ >+ Convert timeout values in WebKitTestRunner to WTF::Seconds >+ https://bugs.webkit.org/show_bug.cgi?id=188987 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Replace various 'int' timeout values with WTF::Seconds. The timeout argument >+ comes in as milliseconds, so convert on input. When sending messages to the InjectedBundle >+ using integers, convert to and from milliseconds. >+ >+ Also do some #pragma once, and initializer cleanup. >+ >+ * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp: >+ (WTR::InjectedBundle::didReceiveMessageToPage): >+ (WTR::InjectedBundle::beginTesting): >+ (WTR::InjectedBundle::InjectedBundle): Deleted. >+ * WebKitTestRunner/InjectedBundle/InjectedBundle.h: >+ * WebKitTestRunner/InjectedBundle/TestRunner.h: >+ (WTR::TestRunner::timeout): >+ (WTR::TestRunner::setCustomTimeout): >+ * WebKitTestRunner/InjectedBundle/gtk/TestRunnerGtk.cpp: >+ (WTR::TestRunner::initializeWaitToDumpWatchdogTimerIfNeeded): >+ * WebKitTestRunner/InjectedBundle/mac/TestRunnerMac.mm: >+ (WTR::TestRunner::invalidateWaitToDumpWatchdogTimer): >+ (WTR::TestRunner::initializeWaitToDumpWatchdogTimerIfNeeded): >+ * WebKitTestRunner/InjectedBundle/wpe/TestRunnerWPE.cpp: >+ (WTR::TestRunner::initializeWaitToDumpWatchdogTimerIfNeeded): >+ * WebKitTestRunner/TestController.cpp: >+ (WTR::TestController::TestController): >+ (WTR::parseInputLine): >+ (WTR::TestController::runTest): >+ (WTR::TestController::runUntil): >+ (WTR::TestController::didReceiveMessageFromInjectedBundle): >+ * WebKitTestRunner/TestController.h: >+ * WebKitTestRunner/TestInvocation.cpp: >+ (WTR::TestInvocation::shortTimeout const): >+ (WTR::TestInvocation::createTestSettingsDictionary): >+ * WebKitTestRunner/TestInvocation.h: >+ * WebKitTestRunner/TestOptions.h: >+ * WebKitTestRunner/cocoa/TestControllerCocoa.mm: >+ (WTR::TestController::platformRunUntil): >+ * WebKitTestRunner/gtk/TestControllerGtk.cpp: >+ (WTR::TestController::platformRunUntil): >+ * WebKitTestRunner/wpe/TestControllerWPE.cpp: >+ (WTR::TestController::platformRunUntil): >+ > 2018-08-24 Myles C. Maxfield <mmaxfield@apple.com> > > Unreviewed test fix after r235249 >diff --git a/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp b/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp >index e6b55e58deb713465dbc5887ceeb6f5888684669..5168ea7d221896624e7d20f729b287d1f9b8917f 100644 >--- a/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp >+++ b/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp >@@ -64,17 +64,6 @@ InjectedBundle& InjectedBundle::singleton() > return shared; > } > >-InjectedBundle::InjectedBundle() >- : m_bundle(0) >- , m_topLoadingFrame(0) >- , m_state(Idle) >- , m_dumpPixels(false) >- , m_useWaitToDumpWatchdogTimer(true) >- , m_useWorkQueue(false) >- , m_timeout(0) >-{ >-} >- > void InjectedBundle::didCreatePage(WKBundleRef bundle, WKBundlePageRef page, const void* clientInfo) > { > static_cast<InjectedBundle*>(const_cast<void*>(clientInfo))->didCreatePage(page); >@@ -205,7 +194,7 @@ void InjectedBundle::didReceiveMessageToPage(WKBundlePageRef page, WKStringRef m > m_useWaitToDumpWatchdogTimer = WKBooleanGetValue(static_cast<WKBooleanRef>(WKDictionaryGetItemForKey(messageBodyDictionary, useWaitToDumpWatchdogTimerKey.get()))); > > WKRetainPtr<WKStringRef> timeoutKey(AdoptWK, WKStringCreateWithUTF8CString("Timeout")); >- m_timeout = (int)WKUInt64GetValue(static_cast<WKUInt64Ref>(WKDictionaryGetItemForKey(messageBodyDictionary, timeoutKey.get()))); >+ m_timeout = Seconds::fromMilliseconds(WKUInt64GetValue(static_cast<WKUInt64Ref>(WKDictionaryGetItemForKey(messageBodyDictionary, timeoutKey.get())))); > > WKRetainPtr<WKStringRef> dumpJSConsoleLogInStdErrKey(AdoptWK, WKStringCreateWithUTF8CString("DumpJSConsoleLogInStdErr")); > m_dumpJSConsoleLogInStdErr = WKBooleanGetValue(static_cast<WKBooleanRef>(WKDictionaryGetItemForKey(messageBodyDictionary, dumpJSConsoleLogInStdErrKey.get()))); >@@ -231,7 +220,6 @@ void InjectedBundle::didReceiveMessageToPage(WKBundlePageRef page, WKStringRef m > > WKRetainPtr<WKStringRef> shouldGCKey(AdoptWK, WKStringCreateWithUTF8CString("ShouldGC")); > bool shouldGC = WKBooleanGetValue(static_cast<WKBooleanRef>(WKDictionaryGetItemForKey(messageBodyDictionary, shouldGCKey.get()))); >- > if (shouldGC) > WKBundleGarbageCollectJavaScriptObjects(m_bundle); > >@@ -487,7 +475,7 @@ void InjectedBundle::beginTesting(WKDictionaryRef settings, BegingTestingMode te > m_testRunner->setTabKeyCyclesThroughElements(true); > m_testRunner->clearTestRunnerCallbacks(); > >- if (m_timeout > 0) >+ if (m_timeout > 0_s) > m_testRunner->setCustomTimeout(m_timeout); > > page()->prepare(); >diff --git a/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.h b/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.h >index 6d4ded8e8a57aa0788f1b707a062de50f1ec0ed2..0ad75e70dd37bab1bc822b55be955cdfd5d42734 100644 >--- a/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.h >+++ b/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.h >@@ -145,7 +145,7 @@ public: > size_t userScriptInjectedCount() const { return m_userScriptInjectedCount; } > > private: >- InjectedBundle(); >+ InjectedBundle() = default; > ~InjectedBundle(); > > static void didCreatePage(WKBundleRef, WKBundlePageRef, const void* clientInfo); >@@ -170,8 +170,8 @@ private: > > bool booleanForKey(WKDictionaryRef, const char* key); > >- WKBundleRef m_bundle; >- WKBundlePageGroupRef m_pageGroup; >+ WKBundleRef m_bundle { nullptr }; >+ WKBundlePageGroupRef m_pageGroup { nullptr }; > Vector<std::unique_ptr<InjectedBundlePage>> m_pages; > > #if HAVE(ACCESSIBILITY) >@@ -182,22 +182,23 @@ private: > RefPtr<EventSendingController> m_eventSendingController; > RefPtr<TextInputController> m_textInputController; > >- WKBundleFrameRef m_topLoadingFrame; >+ WKBundleFrameRef m_topLoadingFrame { nullptr }; > > enum State { > Idle, > Testing, > Stopping > }; >- State m_state; >+ State m_state { Idle }; > >- bool m_dumpPixels; >- bool m_useWaitToDumpWatchdogTimer; >- bool m_useWorkQueue; >- int m_timeout; >+ bool m_dumpPixels { false }; >+ bool m_useWaitToDumpWatchdogTimer { true }; >+ bool m_useWorkQueue { false }; > bool m_pixelResultIsPending { false }; > bool m_dumpJSConsoleLogInStdErr { false }; > >+ WTF::Seconds m_timeout; >+ > WKRetainPtr<WKDataRef> m_audioResult; > WKRetainPtr<WKImageRef> m_pixelResult; > WKRetainPtr<WKArrayRef> m_repaintRects; >diff --git a/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h b/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h >index 013de709e11152d31dce1522c6ac1cbbfee61776..65baa2b390be2d9af73def4bce6cbb5c84e02d63 100644 >--- a/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h >+++ b/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h >@@ -33,6 +33,7 @@ > #include <WebKit/WKRetainPtr.h> > #include <string> > #include <wtf/Ref.h> >+#include <wtf/Seconds.h> > #include <wtf/text/WTFString.h> > > #if PLATFORM(COCOA) >@@ -71,7 +72,7 @@ public: > void waitUntilDone(); > void notifyDone(); > double preciseTime(); >- double timeout() { return m_timeout; } >+ double timeout() { return m_timeout.seconds(); } > > // Other dumping. > void dumpBackForwardList() { m_shouldDumpBackForwardListsForAllWindows = true; } >@@ -315,7 +316,7 @@ public: > > bool callShouldCloseOnWebView(); > >- void setCustomTimeout(int duration) { m_timeout = duration; } >+ void setCustomTimeout(WTF::Seconds duration) { m_timeout = duration; } > > // Work queue. > void queueBackNavigation(unsigned howFarBackward); >@@ -512,7 +513,7 @@ private: > bool m_globalFlag; > bool m_customFullScreenBehavior; > >- int m_timeout; >+ WTF::Seconds m_timeout; > > double m_databaseDefaultQuota; > double m_databaseMaxQuota; >diff --git a/Tools/WebKitTestRunner/InjectedBundle/gtk/TestRunnerGtk.cpp b/Tools/WebKitTestRunner/InjectedBundle/gtk/TestRunnerGtk.cpp >index 62dd844004e03e250418364614c616dd15e08c84..10c999f45858c5b7e8911f29ec9ad83f93c826ef 100644 >--- a/Tools/WebKitTestRunner/InjectedBundle/gtk/TestRunnerGtk.cpp >+++ b/Tools/WebKitTestRunner/InjectedBundle/gtk/TestRunnerGtk.cpp >@@ -49,7 +49,7 @@ void TestRunner::initializeWaitToDumpWatchdogTimerIfNeeded() > if (m_waitToDumpWatchdogTimer.isActive()) > return; > >- m_waitToDumpWatchdogTimer.startOneShot(1_ms * m_timeout); >+ m_waitToDumpWatchdogTimer.startOneShot(m_timeout); > } > > JSRetainPtr<JSStringRef> TestRunner::pathToLocalResource(JSStringRef url) >diff --git a/Tools/WebKitTestRunner/InjectedBundle/mac/TestRunnerMac.mm b/Tools/WebKitTestRunner/InjectedBundle/mac/TestRunnerMac.mm >index b4a7c4a754ce8575d50ec0cf64db310a27b758c7..68435a83fece09258bbb9cb46a61cd5e9b8e0cb2 100644 >--- a/Tools/WebKitTestRunner/InjectedBundle/mac/TestRunnerMac.mm >+++ b/Tools/WebKitTestRunner/InjectedBundle/mac/TestRunnerMac.mm >@@ -48,7 +48,7 @@ void TestRunner::invalidateWaitToDumpWatchdogTimer() > return; > > CFRunLoopTimerInvalidate(m_waitToDumpWatchdogTimer.get()); >- m_waitToDumpWatchdogTimer = 0; >+ m_waitToDumpWatchdogTimer = nullptr; > } > > static void waitUntilDoneWatchdogTimerFired(CFRunLoopTimerRef timer, void* info) >@@ -61,7 +61,7 @@ void TestRunner::initializeWaitToDumpWatchdogTimerIfNeeded() > if (m_waitToDumpWatchdogTimer) > return; > >- CFTimeInterval interval = m_timeout / 1000.0; >+ CFTimeInterval interval = m_timeout.seconds(); > m_waitToDumpWatchdogTimer = adoptCF(CFRunLoopTimerCreate(kCFAllocatorDefault, CFAbsoluteTimeGetCurrent() + interval, 0, 0, 0, WTR::waitUntilDoneWatchdogTimerFired, NULL)); > CFRunLoopAddTimer(CFRunLoopGetCurrent(), m_waitToDumpWatchdogTimer.get(), kCFRunLoopCommonModes); > } >diff --git a/Tools/WebKitTestRunner/InjectedBundle/wpe/TestRunnerWPE.cpp b/Tools/WebKitTestRunner/InjectedBundle/wpe/TestRunnerWPE.cpp >index 27abc2ac4b22de948bedec244b415e3812680432..25fbff5afab110ed7d7498097b4557ebe2cec164 100644 >--- a/Tools/WebKitTestRunner/InjectedBundle/wpe/TestRunnerWPE.cpp >+++ b/Tools/WebKitTestRunner/InjectedBundle/wpe/TestRunnerWPE.cpp >@@ -52,7 +52,7 @@ void TestRunner::platformInitialize() > void TestRunner::initializeWaitToDumpWatchdogTimerIfNeeded() > { > if (!m_waitToDumpWatchdogTimer.isActive()) >- m_waitToDumpWatchdogTimer.startOneShot(1_ms * m_timeout); >+ m_waitToDumpWatchdogTimer.startOneShot(m_timeout); > } > > void TestRunner::installFakeHelvetica(JSStringRef configuration) >diff --git a/Tools/WebKitTestRunner/TestController.cpp b/Tools/WebKitTestRunner/TestController.cpp >index 59ce258584ece0af9d851dc8d2e6cf225b860c00..fedca39267662d2493b7753a6d539f11cac81771 100644 >--- a/Tools/WebKitTestRunner/TestController.cpp >+++ b/Tools/WebKitTestRunner/TestController.cpp >@@ -94,9 +94,8 @@ const unsigned TestController::viewHeight = 600; > const unsigned TestController::w3cSVGViewWidth = 480; > const unsigned TestController::w3cSVGViewHeight = 360; > >-const double TestController::defaultShortTimeout = 5.0; >- >-const double TestController::noTimeout = -1; >+const WTF::Seconds TestController::defaultShortTimeout = 5_s; >+const WTF::Seconds TestController::noTimeout = -1_s; > > static WKURLRef blankURL() > { >@@ -129,7 +128,7 @@ TestController::TestController(int argc, const char* argv[]) > initialize(argc, argv); > controller = this; > run(); >- controller = 0; >+ controller = nullptr; > } > > TestController::~TestController() >@@ -1252,7 +1251,7 @@ TestCommand parseInputLine(const std::string& inputLine) > arg = tokenizer.next(); > if (arg == std::string("--timeout")) { > std::string timeoutToken = tokenizer.next(); >- result.timeout = atoi(timeoutToken.c_str()); >+ result.timeout = Seconds::fromMilliseconds(atoi(timeoutToken.c_str())); > } else if (arg == std::string("-p") || arg == std::string("--pixel-test")) { > result.shouldDumpPixels = true; > if (tokenizer.hasNext()) >@@ -1283,8 +1282,10 @@ bool TestController::runTest(const char* inputLine) > > if (command.shouldDumpPixels || m_shouldDumpPixelsForAllTests) > m_currentInvocation->setIsPixelTest(command.expectedPixelHash); >- if (command.timeout > 0) >+ >+ if (command.timeout > 0_s) > m_currentInvocation->setCustomTimeout(command.timeout); >+ > m_currentInvocation->setDumpJSConsoleLogInStdErr(command.dumpJSConsoleLogInStdErr || options.dumpJSConsoleLogInStdErr); > > platformWillRunTest(*m_currentInvocation); >@@ -1323,7 +1324,7 @@ void TestController::run() > } > } > >-void TestController::runUntil(bool& done, double timeout) >+void TestController::runUntil(bool& done, WTF::Seconds timeout) > { > if (m_forceNoTimeout) > timeout = noTimeout; >@@ -1414,7 +1415,6 @@ void TestController::didReceiveMessageFromInjectedBundle(WKStringRef messageName > > if (WKStringIsEqualToUTF8CString(subMessageName, "KeyDown")) { > didReceiveKeyDownMessageFromInjectedBundle(messageBodyDictionary, false); >- > return; > } > >diff --git a/Tools/WebKitTestRunner/TestController.h b/Tools/WebKitTestRunner/TestController.h >index 08b67af757559fcc20f646f02e1bb947c587e405..16225b50fa9cc5cd6360602ae75eb66a1b765b16 100644 >--- a/Tools/WebKitTestRunner/TestController.h >+++ b/Tools/WebKitTestRunner/TestController.h >@@ -23,8 +23,7 @@ > * THE POSSIBILITY OF SUCH DAMAGE. > */ > >-#ifndef TestController_h >-#define TestController_h >+#pragma once > > #include "GeolocationProviderMock.h" > #include "WebNotificationProvider.h" >@@ -34,6 +33,7 @@ > #include <string> > #include <vector> > #include <wtf/HashMap.h> >+#include <wtf/Seconds.h> > #include <wtf/Vector.h> > #include <wtf/text/StringHash.h> > >@@ -59,8 +59,8 @@ public: > static const unsigned w3cSVGViewWidth; > static const unsigned w3cSVGViewHeight; > >- static const double defaultShortTimeout; >- static const double noTimeout; >+ static const WTF::Seconds defaultShortTimeout; >+ static const WTF::Seconds noTimeout; > > TestController(int argc, const char* argv[]); > ~TestController(); >@@ -79,7 +79,7 @@ public: > > // Runs the run loop until `done` is true or the timeout elapses. > bool useWaitToDumpWatchdogTimer() { return m_useWaitToDumpWatchdogTimer; } >- void runUntil(bool& done, double timeoutSeconds); >+ void runUntil(bool& done, WTF::Seconds timeout); > void notifyDone(); > > bool shouldShowWebView() const { return m_shouldShowWebView; } >@@ -247,7 +247,7 @@ private: > #endif > void platformConfigureViewForTest(const TestInvocation&); > void platformWillRunTest(const TestInvocation&); >- void platformRunUntil(bool& done, double timeout); >+ void platformRunUntil(bool& done, WTF::Seconds timeout); > void platformDidCommitLoadForFrame(WKPageRef, WKFrameRef); > WKContextRef platformContext(); > WKPreferencesRef platformPreferences(); >@@ -291,7 +291,6 @@ private: > static void didFinishNavigation(WKPageRef, WKNavigationRef, WKTypeRef userData, const void*); > void didFinishNavigation(WKPageRef, WKNavigationRef); > >- > // WKContextDownloadClient > static void downloadDidStart(WKContextRef, WKDownloadRef, const void*); > void downloadDidStart(WKContextRef, WKDownloadRef); >@@ -450,12 +449,10 @@ private: > struct TestCommand { > std::string pathOrURL; > std::string absolutePath; >- bool shouldDumpPixels { false }; > std::string expectedPixelHash; >- int timeout { 0 }; >+ WTF::Seconds timeout; >+ bool shouldDumpPixels { false }; > bool dumpJSConsoleLogInStdErr { false }; > }; > > } // namespace WTR >- >-#endif // TestController_h >diff --git a/Tools/WebKitTestRunner/TestInvocation.cpp b/Tools/WebKitTestRunner/TestInvocation.cpp >index f8ee616fed62c30ed7504520dd55543301433b51..bc1eaf63e40079aa334c1fa5574907a6573bb7ed 100644 >--- a/Tools/WebKitTestRunner/TestInvocation.cpp >+++ b/Tools/WebKitTestRunner/TestInvocation.cpp >@@ -101,7 +101,7 @@ void TestInvocation::setIsPixelTest(const std::string& expectedPixelHash) > m_expectedPixelHash = expectedPixelHash; > } > >-double TestInvocation::shortTimeout() const >+WTF::Seconds TestInvocation::shortTimeout() const > { > if (!m_timeout) { > // Running WKTR directly, without webkitpy. >@@ -112,7 +112,7 @@ double TestInvocation::shortTimeout() const > // but it currently does. There is no way to know what a normal test's timeout is, as webkitpy only passes timeouts > // for each test individually. > // But there shouldn't be any observable negative consequences from this. >- return m_timeout / 1000. / 4; >+ return m_timeout / 4; > } > > bool TestInvocation::shouldLogHistoryClientCallbacks() const >@@ -137,7 +137,7 @@ WKRetainPtr<WKMutableDictionaryRef> TestInvocation::createTestSettingsDictionary > WKDictionarySetItem(beginTestMessageBody.get(), useWaitToDumpWatchdogTimerKey.get(), useWaitToDumpWatchdogTimerValue.get()); > > WKRetainPtr<WKStringRef> timeoutKey = adoptWK(WKStringCreateWithUTF8CString("Timeout")); >- WKRetainPtr<WKUInt64Ref> timeoutValue = adoptWK(WKUInt64Create(m_timeout)); >+ WKRetainPtr<WKUInt64Ref> timeoutValue = adoptWK(WKUInt64Create(m_timeout.milliseconds())); > WKDictionarySetItem(beginTestMessageBody.get(), timeoutKey.get(), timeoutValue.get()); > > WKRetainPtr<WKStringRef> dumpJSConsoleLogInStdErrKey = adoptWK(WKStringCreateWithUTF8CString("DumpJSConsoleLogInStdErr")); >diff --git a/Tools/WebKitTestRunner/TestInvocation.h b/Tools/WebKitTestRunner/TestInvocation.h >index 72173b7ebdd5a068211aab9f23a178b7ec72938b..3c050edadb1cefda962a5c47319b8f11bcd26af3 100644 >--- a/Tools/WebKitTestRunner/TestInvocation.h >+++ b/Tools/WebKitTestRunner/TestInvocation.h >@@ -33,6 +33,7 @@ > #include <WebKit/WKRetainPtr.h> > #include <string> > #include <wtf/Noncopyable.h> >+#include <wtf/Seconds.h> > #include <wtf/text/StringBuilder.h> > > namespace WTR { >@@ -50,12 +51,10 @@ public: > > void setIsPixelTest(const std::string& expectedPixelHash); > >- // Milliseconds >- void setCustomTimeout(int duration) { m_timeout = duration; } >+ void setCustomTimeout(WTF::Seconds duration) { m_timeout = duration; } > void setDumpJSConsoleLogInStdErr(bool value) { m_dumpJSConsoleLogInStdErr = value; } > >- // Seconds >- double shortTimeout() const; >+ WTF::Seconds shortTimeout() const; > > void invoke(); > void didReceiveMessageFromInjectedBundle(WKStringRef messageName, WKTypeRef messageBody); >@@ -116,7 +115,7 @@ private: > > std::string m_expectedPixelHash; > >- int m_timeout { 0 }; >+ WTF::Seconds m_timeout; > bool m_dumpJSConsoleLogInStdErr { false }; > > // Invocation state >diff --git a/Tools/WebKitTestRunner/TestOptions.h b/Tools/WebKitTestRunner/TestOptions.h >index 6068abf8b35574d471d4349557f93020b8ef3541..290b3bbd7417ed82e9d73b3788a6361488c8a016 100644 >--- a/Tools/WebKitTestRunner/TestOptions.h >+++ b/Tools/WebKitTestRunner/TestOptions.h >@@ -23,8 +23,7 @@ > * THE POSSIBILITY OF SUCH DAMAGE. > */ > >-#ifndef TestOptions_h >-#define TestOptions_h >+#pragma once > > #include <wtf/Vector.h> > #include <wtf/text/WTFString.h> >@@ -111,5 +110,3 @@ struct TestOptions { > }; > > } >- >-#endif // TestOptions_h >diff --git a/Tools/WebKitTestRunner/cocoa/TestControllerCocoa.mm b/Tools/WebKitTestRunner/cocoa/TestControllerCocoa.mm >index 5d495eb736e5af76634fb9b3d062ff434790db15..240eeb52f306784117ca5b8a96d8e3fc9307179e 100644 >--- a/Tools/WebKitTestRunner/cocoa/TestControllerCocoa.mm >+++ b/Tools/WebKitTestRunner/cocoa/TestControllerCocoa.mm >@@ -196,9 +196,9 @@ WKContextRef TestController::platformAdjustContext(WKContextRef context, WKConte > #endif > } > >-void TestController::platformRunUntil(bool& done, double timeout) >+void TestController::platformRunUntil(bool& done, WTF::Seconds timeout) > { >- NSDate *endDate = (timeout > 0) ? [NSDate dateWithTimeIntervalSinceNow:timeout] : [NSDate distantFuture]; >+ NSDate *endDate = (timeout > 0_s) ? [NSDate dateWithTimeIntervalSinceNow:timeout.seconds()] : [NSDate distantFuture]; > > while (!done && [endDate compare:[NSDate date]] == NSOrderedDescending) > [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:endDate]; >diff --git a/Tools/WebKitTestRunner/gtk/TestControllerGtk.cpp b/Tools/WebKitTestRunner/gtk/TestControllerGtk.cpp >index aa5885b6480188d1c6f3bdbd908c009439fa2a3e..b431a1516e24335e51f16c828e196b82cc28f926 100644 >--- a/Tools/WebKitTestRunner/gtk/TestControllerGtk.cpp >+++ b/Tools/WebKitTestRunner/gtk/TestControllerGtk.cpp >@@ -74,13 +74,12 @@ void TestController::platformDestroy() > { > } > >-void TestController::platformRunUntil(bool&, double timeout) >+void TestController::platformRunUntil(bool&, WTF::Seconds timeout) > { > if (timeout > 0) { > // FIXME: This conversion is now repeated in several places, it should be moved to a common place in WTF and used everywhere. >- auto timeoutDuration = Seconds { timeout }; > gint64 currentTime = g_get_monotonic_time(); >- gint64 targetTime = currentTime + std::min<gint64>(G_MAXINT64 - currentTime, timeoutDuration.microsecondsAs<int64_t>()); >+ gint64 targetTime = currentTime + std::min<gint64>(G_MAXINT64 - currentTime, timeout.microsecondsAs<int64_t>()); > ASSERT(targetTime >= currentTime); > g_source_set_ready_time(timeoutSource(), targetTime); > } else >diff --git a/Tools/WebKitTestRunner/wpe/TestControllerWPE.cpp b/Tools/WebKitTestRunner/wpe/TestControllerWPE.cpp >index b7b1e4d706c363cc69e2a3fef0e4f7d8ee005621..fe30d3de8552575a86fee6a4587b45354b18ed5c 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, double timeout) >+void TestController::platformRunUntil(bool& condition, WTF::Seconds timeout) > { > struct TimeoutTimer { > TimeoutTimer() >@@ -70,8 +70,8 @@ void TestController::platformRunUntil(bool& condition, double timeout) > } timeoutTimer; > > timeoutTimer.timer.setPriority(G_PRIORITY_DEFAULT_IDLE); >- if (timeout >= 0) >- timeoutTimer.timer.startOneShot(Seconds(timeout)); >+ if (timeout >= 0_s) >+ timeoutTimer.timer.startOneShot(timeout); > > RunLoop::main().run(); >
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 188987
:
348158
|
348164
|
348181
|
348183