Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2014 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 "base/basictypes.h" | |
| 6 #include "base/compiler_specific.h" | |
| 7 #include "cc/test/layer_tree_test.h" | |
| 8 #include "cc/trees/thread_proxy.h" | |
| 9 | |
| 10 namespace cc { | |
| 11 | |
| 12 class ThreadProxyTest : public LayerTreeTest { | |
| 13 public: | |
| 14 ThreadProxyTest() {} | |
| 15 virtual ~ThreadProxyTest() {} | |
| 16 | |
| 17 void RunTest() { | |
| 18 // We don't need to care about delegating, impl side painting because | |
| 19 // ThreadProxyTest only cover ThreadProxy itself. | |
| 20 // So, true is passed to all parameters. | |
| 21 bool threaded = true; | |
| 22 bool delegating_renderer = true; | |
| 23 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.
| |
| 24 LayerTreeTest::RunTest(threaded, delegating_renderer, impl_side_painting); | |
| 25 } | |
| 26 | |
| 27 private: | |
| 28 DISALLOW_COPY_AND_ASSIGN(ThreadProxyTest); | |
| 29 }; | |
| 30 | |
| 31 class ThreadProxyTestSetNeedsCommit : public ThreadProxyTest { | |
| 32 public: | |
| 33 void BeginTest() OVERRIDE { | |
| 34 EXPECT_FALSE(ThreadProxyMainOnly().commit_requested); | |
| 35 EXPECT_FALSE(ThreadProxyMainOnly().commit_request_sent_to_impl_thread); | |
| 36 | |
| 37 proxy()->SetNeedsCommit(); | |
| 38 | |
| 39 EXPECT_TRUE(ThreadProxyMainOnly().commit_requested); | |
| 40 EXPECT_TRUE(ThreadProxyMainOnly().commit_request_sent_to_impl_thread); | |
| 41 } | |
| 42 | |
| 43 void DidBeginMainFrame() OVERRIDE { | |
| 44 EXPECT_FALSE(ThreadProxyMainOnly().commit_requested); | |
| 45 EXPECT_FALSE(ThreadProxyMainOnly().commit_request_sent_to_impl_thread); | |
| 46 | |
| 47 EndTest(); | |
| 48 } | |
| 49 | |
| 50 void AfterTest() OVERRIDE {} | |
| 51 | |
| 52 protected: | |
| 53 ThreadProxyTestSetNeedsCommit() {} | |
| 54 virtual ~ThreadProxyTestSetNeedsCommit() {} | |
| 55 | |
| 56 private: | |
| 57 DISALLOW_COPY_AND_ASSIGN(ThreadProxyTestSetNeedsCommit); | |
| 58 }; | |
| 59 | |
| 60 TEST_F(ThreadProxyTestSetNeedsCommit, SetNeedsCommitTest) { | |
| 61 RunTest(); | |
| 62 } | |
| 63 | |
| 64 } // namespace cc | |
| OLD | NEW |