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 |