Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(731)

Unified Diff: mojo/public/cpp/bindings/tests/wtf_test_base.cc

Issue 1751563002: Mojo C++ bindings: support mapping mojo string to WTF::String. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: mojo/public/cpp/bindings/tests/wtf_test_base.cc
diff --git a/mojo/public/cpp/bindings/tests/wtf_test_base.cc b/mojo/public/cpp/bindings/tests/wtf_test_base.cc
new file mode 100644
index 0000000000000000000000000000000000000000..086946eac121d4785ac10f7021485a19459958db
--- /dev/null
+++ b/mojo/public/cpp/bindings/tests/wtf_test_base.cc
@@ -0,0 +1,40 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "mojo/public/cpp/bindings/tests/wtf_test_base.h"
+
+#include "third_party/WebKit/Source/wtf/CurrentTime.h"
+#include "third_party/WebKit/Source/wtf/MainThread.h"
+#include "third_party/WebKit/Source/wtf/Partitions.h"
+#include "third_party/WebKit/Source/wtf/WTF.h"
+
+namespace mojo {
+namespace test {
+namespace {
+
+double DummyGetCurrentTime() {
+ return 0.0;
+}
+
+bool g_wtf_initialized = false;
+
+} // namespace
+
+WTFTestBase::~WTFTestBase() {}
+
+WTFTestBase::WTFTestBase() {}
+
+void WTFTestBase::SetUp() {
+ if (g_wtf_initialized)
+ return;
+
+ WTF::Partitions::initialize(nullptr);
+ WTF::setTimeFunctionsForTesting(DummyGetCurrentTime);
+ WTF::initialize(nullptr);
+ WTF::initializeMainThread(0);
+ 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/)
+}
+
+} // namespace test
+} // namespace mojo
« no previous file with comments | « mojo/public/cpp/bindings/tests/wtf_test_base.h ('k') | mojo/public/cpp/bindings/tests/wtf_types_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698