OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #include "mojo/public/cpp/bindings/tests/wtf_test_base.h" | |
6 | |
7 #include "third_party/WebKit/Source/wtf/CurrentTime.h" | |
8 #include "third_party/WebKit/Source/wtf/MainThread.h" | |
9 #include "third_party/WebKit/Source/wtf/Partitions.h" | |
10 #include "third_party/WebKit/Source/wtf/WTF.h" | |
11 | |
12 namespace mojo { | |
13 namespace test { | |
14 namespace { | |
15 | |
16 double DummyGetCurrentTime() { | |
17 return 0.0; | |
18 } | |
19 | |
20 bool g_wtf_initialized = false; | |
21 | |
22 } // namespace | |
23 | |
24 WTFTestBase::~WTFTestBase() {} | |
25 | |
26 WTFTestBase::WTFTestBase() {} | |
27 | |
28 void WTFTestBase::SetUp() { | |
29 if (g_wtf_initialized) | |
30 return; | |
31 | |
32 WTF::Partitions::initialize(nullptr); | |
33 WTF::setTimeFunctionsForTesting(DummyGetCurrentTime); | |
34 WTF::initialize(nullptr); | |
35 WTF::initializeMainThread(0); | |
36 g_wtf_initialized = true; | |
haraken
2016/03/07 23:54:17
Can we use blink::initializeWithoutV8/shutdownWith
yzshen1
2016/03/08 00:17:09
I tried it, but that requires to link against the
haraken
2016/03/08 00:29:29
Then can we add a public API (in public/platform/)
| |
37 } | |
38 | |
39 } // namespace test | |
40 } // namespace mojo | |
OLD | NEW |