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

Unified Diff: cc/trees/layer_tree_host_unittest_proxy.cc

Issue 242783003: cc: Add testing stubs for proxy test (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 6 years, 7 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: cc/trees/layer_tree_host_unittest_proxy.cc
diff --git a/cc/trees/layer_tree_host_unittest_proxy.cc b/cc/trees/layer_tree_host_unittest_proxy.cc
new file mode 100644
index 0000000000000000000000000000000000000000..9616f26eadcb9cffa0d833a4f563f3d0fcb7b76a
--- /dev/null
+++ b/cc/trees/layer_tree_host_unittest_proxy.cc
@@ -0,0 +1,64 @@
+// Copyright 2014 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 "base/basictypes.h"
+#include "base/compiler_specific.h"
+#include "cc/test/layer_tree_test.h"
+#include "cc/trees/thread_proxy.h"
+
+namespace cc {
+
+class ThreadProxyTest : public LayerTreeTest {
+ public:
+ ThreadProxyTest() {}
+ virtual ~ThreadProxyTest() {}
+
+ void RunTest() {
+ // We don't need to care about delegating, impl side painting because
+ // ThreadProxyTest only cover ThreadProxy itself.
+ // So, true is passed to all parameters.
+ bool threaded = true;
+ bool delegating_renderer = true;
+ bool impl_side_painting = true;
brianderson 2014/05/14 21:12:07 Note: We will care about impl-side-painting since
simonhong 2014/05/15 01:32:07 Yep. changed to it configurable.
+ LayerTreeTest::RunTest(threaded, delegating_renderer, impl_side_painting);
+ }
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ThreadProxyTest);
+};
+
+class ThreadProxyTestSetNeedsCommit : public ThreadProxyTest {
+ public:
+ void BeginTest() OVERRIDE {
+ EXPECT_FALSE(ThreadProxyMainOnly().commit_requested);
+ EXPECT_FALSE(ThreadProxyMainOnly().commit_request_sent_to_impl_thread);
+
+ proxy()->SetNeedsCommit();
+
+ EXPECT_TRUE(ThreadProxyMainOnly().commit_requested);
+ EXPECT_TRUE(ThreadProxyMainOnly().commit_request_sent_to_impl_thread);
+ }
+
+ void DidBeginMainFrame() OVERRIDE {
+ EXPECT_FALSE(ThreadProxyMainOnly().commit_requested);
+ EXPECT_FALSE(ThreadProxyMainOnly().commit_request_sent_to_impl_thread);
+
+ EndTest();
+ }
+
+ void AfterTest() OVERRIDE {}
+
+ protected:
+ ThreadProxyTestSetNeedsCommit() {}
+ virtual ~ThreadProxyTestSetNeedsCommit() {}
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ThreadProxyTestSetNeedsCommit);
+};
+
+TEST_F(ThreadProxyTestSetNeedsCommit, SetNeedsCommitTest) {
+ RunTest();
+}
+
+} // namespace cc

Powered by Google App Engine
This is Rietveld 408576698