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

Unified Diff: cc/test/test_webkit_platform.cc

Issue 10918281: Enable webkit_compositor_bindings_unittests in component builds (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 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
« no previous file with comments | « cc/test/test_webkit_platform.h ('k') | webkit/DEPS » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/test/test_webkit_platform.cc
diff --git a/cc/test/test_webkit_platform.cc b/cc/test/test_webkit_platform.cc
new file mode 100644
index 0000000000000000000000000000000000000000..403ba6130142b94716218a2b57fe9838e3b94915
--- /dev/null
+++ b/cc/test/test_webkit_platform.cc
@@ -0,0 +1,53 @@
+// Copyright (c) 2012 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 "cc/test/test_webkit_platform.h"
+
+namespace cc {
+
+TestWebKitPlatform::TestWebKitPlatform() {
+}
+
+TestWebKitPlatform::~TestWebKitPlatform() {
+}
+
+WebKit::WebCompositorSupport* TestWebKitPlatform::compositorSupport() {
+ return &compositor_support_;
+}
+
+void TestWebKitPlatform::cryptographicallyRandomValues(
+ unsigned char* buffer, size_t length) {
+ base::RandBytes(buffer, length);
+}
+
+WebKit::WebThread* TestWebKitPlatform::createThread(const char* name) {
+ return new webkit_glue::WebThreadImpl(name);
+}
+
+WebKit::WebThread* TestWebKitPlatform::currentThread() {
+ webkit_glue::WebThreadImplForMessageLoop* thread =
+ static_cast<WebThreadImplForMessageLoop*>(current_thread_slot_.Get());
+ if (thread)
+ return (thread);
+
+ scoped_refptr<base::MessageLoopProxy> message_loop =
+ base::MessageLoopProxy::current();
+ if (!message_loop)
+ return NULL;
+
+ thread = new WebThreadImplForMessageLoop(message_loop);
+ current_thread_slot_.Set(thread);
+ return thread;
+}
+
+double TestWebKitPlatform::currentTime() {
+ return base::Time::Now().ToDoubleT();
+}
+
+double TestWebKitPlatform::monotonicallyIncreasingTime() {
+ return base::TimeTicks::Now().ToInternalValue() /
+ static_cast<double>(base::Time::kMicrosecondsPerSecond);
+}
+
+}
« no previous file with comments | « cc/test/test_webkit_platform.h ('k') | webkit/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698