Chromium Code Reviews| Index: cc/trees/layer_tree_host_unittest.cc |
| diff --git a/cc/trees/layer_tree_host_unittest.cc b/cc/trees/layer_tree_host_unittest.cc |
| index 470a63b1b3ae3651e581e45e3b81796ba712c75e..91ca4001f2db1b769e5594fe9877495e2db6dbe7 100644 |
| --- a/cc/trees/layer_tree_host_unittest.cc |
| +++ b/cc/trees/layer_tree_host_unittest.cc |
| @@ -272,6 +272,42 @@ class LayerTreeHostTestReadyToDrawNonEmpty |
| // single threaded mode. |
| SINGLE_THREAD_TEST_F(LayerTreeHostTestReadyToDrawNonEmpty); |
| +// This tests if we get the READY_TO_DRAW signal if we become invisible and then |
| +// become visible again. |
| +class LayerTreeHostTestReadyToDrawVisibility |
| + : public LayerTreeHostTestReadyToDrawNonEmpty { |
| + public: |
| + LayerTreeHostTestReadyToDrawVisibility() |
| + : LayerTreeHostTestReadyToDrawNonEmpty(), commit_count_(0) {} |
| + |
| + void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) override { |
| + commit_count_++; |
| + if (commit_count_ == 1) { |
| + DebugScopedSetMainThread main(proxy()); |
| + layer_tree_host()->SetVisible(false); |
|
brianderson
2015/07/23 22:58:15
EXPECT_FALSE(host_impl->visible()) here?
sunnyps
2015/07/23 23:10:50
Done.
|
| + } |
| + } |
| + |
| + void DidFinishImplFrameOnThread(LayerTreeHostImpl* host_impl) override { |
| + if (commit_count_ == 1) { |
| + DebugScopedSetMainThread main(proxy()); |
| + layer_tree_host()->SetVisible(true); |
|
brianderson
2015/07/23 22:58:15
EXPECT_TRUE(host_impl->visible()) here?
sunnyps
2015/07/23 23:10:50
Done.
|
| + } |
| + } |
| + |
| + void AfterTest() override { |
| + LayerTreeHostTestReadyToDrawNonEmpty::AfterTest(); |
| + EXPECT_EQ(2, commit_count_); |
| + } |
| + |
| + private: |
| + int commit_count_; |
| +}; |
| + |
| +// Note: With this test setup, we only get tiles flagged as REQUIRED_FOR_DRAW in |
| +// single threaded mode. |
| +SINGLE_THREAD_TEST_F(LayerTreeHostTestReadyToDrawVisibility); |
| + |
| class LayerTreeHostFreeWorkerContextResourcesTest : public LayerTreeHostTest { |
| public: |
| scoped_ptr<FakeOutputSurface> CreateFakeOutputSurface() override { |