Chromium Code Reviews| Index: third_party/WebKit/Source/platform/testing/RunAllTests.cpp |
| diff --git a/third_party/WebKit/Source/platform/testing/RunAllTests.cpp b/third_party/WebKit/Source/platform/testing/RunAllTests.cpp |
| index 8de5d6be20778d310852d32223a8c74f96ef1db6..dae2e0d494bf40f9b50de4dcdba08dce8add9c78 100644 |
| --- a/third_party/WebKit/Source/platform/testing/RunAllTests.cpp |
| +++ b/third_party/WebKit/Source/platform/testing/RunAllTests.cpp |
| @@ -33,6 +33,7 @@ |
| #include "platform/heap/Heap.h" |
| #include "platform/testing/TestingPlatformSupport.h" |
| #include "wtf/CryptographicallyRandomNumber.h" |
| +#include "wtf/CurrentTime.h" |
| #include "wtf/MainThread.h" |
| #include "wtf/Partitions.h" |
| #include "wtf/WTF.h" |
| @@ -43,11 +44,6 @@ |
| #include <cc/blink/web_compositor_support_impl.h> |
| #include <string.h> |
| -static double CurrentTime() |
| -{ |
| - return 0.0; |
| -} |
| - |
| static void AlwaysZeroNumberSource(unsigned char* buf, size_t len) |
| { |
| memset(buf, '\0', len); |
| @@ -63,7 +59,10 @@ static int runTestSuite(base::TestSuite* testSuite) |
| int main(int argc, char** argv) |
| { |
| WTF::setRandomSource(AlwaysZeroNumberSource); |
| - WTF::initialize(CurrentTime, CurrentTime, CurrentTime, nullptr, nullptr); |
| + WTF::setTimeFunctionsForTesting([]() -> double { |
|
haraken
2015/12/28 02:24:27
Nit: I've never seen Blink using the []()-> syntax
Yuta Kitamura
2016/01/05 05:31:06
I think mine is clearer and simpler, but I'd defer
|
| + return 0.0; |
| + }); |
| + WTF::initialize(nullptr, nullptr); |
| WTF::initializeMainThread(0); |
| blink::TestingPlatformSupport::Config platformConfig; |