| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "cc/layers/heads_up_display_layer.h" | 5 #include "cc/layers/heads_up_display_layer.h" |
| 6 #include "cc/layers/layer.h" | 6 #include "cc/layers/layer.h" |
| 7 #include "cc/test/layer_tree_test.h" | 7 #include "cc/test/layer_tree_test.h" |
| 8 #include "cc/trees/layer_tree_host.h" | 8 #include "cc/trees/layer_tree_host.h" |
| 9 | 9 |
| 10 namespace cc { | 10 namespace cc { |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 | 39 |
| 40 virtual void BeginTest() OVERRIDE { | 40 virtual void BeginTest() OVERRIDE { |
| 41 root_layer1_->SetBounds(gfx::Size(30, 30)); | 41 root_layer1_->SetBounds(gfx::Size(30, 30)); |
| 42 root_layer2_->SetBounds(gfx::Size(30, 30)); | 42 root_layer2_->SetBounds(gfx::Size(30, 30)); |
| 43 | 43 |
| 44 PostSetNeedsCommitToMainThread(); | 44 PostSetNeedsCommitToMainThread(); |
| 45 } | 45 } |
| 46 | 46 |
| 47 virtual void DidCommit() OVERRIDE { | 47 virtual void DidCommit() OVERRIDE { |
| 48 ++num_commits_; | 48 ++num_commits_; |
| 49 TRACE_EVENT1("cc", "DidCommit", "num_commits", num_commits_) |
| 49 | 50 |
| 50 ASSERT_TRUE(layer_tree_host()->hud_layer()); | 51 ASSERT_TRUE(layer_tree_host()->hud_layer()); |
| 51 | 52 |
| 52 switch (num_commits_) { | 53 switch (num_commits_) { |
| 53 case 1: | 54 case 1: |
| 54 // Change directly to a new root layer. | 55 // Change directly to a new root layer. |
| 55 layer_tree_host()->SetRootLayer(root_layer1_); | 56 layer_tree_host()->SetRootLayer(root_layer1_); |
| 56 break; | 57 break; |
| 57 case 2: | 58 case 2: |
| 58 EXPECT_EQ(root_layer1_.get(), layer_tree_host()->hud_layer()->parent()); | 59 EXPECT_EQ(root_layer1_.get(), layer_tree_host()->hud_layer()->parent()); |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 private: | 92 private: |
| 92 scoped_refptr<DrawsContentLayer> root_layer1_; | 93 scoped_refptr<DrawsContentLayer> root_layer1_; |
| 93 scoped_refptr<DrawsContentLayer> root_layer2_; | 94 scoped_refptr<DrawsContentLayer> root_layer2_; |
| 94 int num_commits_; | 95 int num_commits_; |
| 95 }; | 96 }; |
| 96 | 97 |
| 97 MULTI_THREAD_TEST_F(HudWithRootLayerChange); | 98 MULTI_THREAD_TEST_F(HudWithRootLayerChange); |
| 98 | 99 |
| 99 } // namespace | 100 } // namespace |
| 100 } // namespace cc | 101 } // namespace cc |
| OLD | NEW |