| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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 "ui/views/view.h" | 5 #include "ui/views/view.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "ui/aura/window.h" | 9 #include "ui/aura/window.h" |
| 10 #include "ui/compositor/layer.h" | 10 #include "ui/compositor/layer.h" |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 // +-- v2 (no layer) | 54 // +-- v2 (no layer) |
| 55 // +-- v3 (no layer) | 55 // +-- v3 (no layer) |
| 56 // +-- v4 | 56 // +-- v4 |
| 57 // +-- w2 | 57 // +-- w2 |
| 58 // +-- v5 | 58 // +-- v5 |
| 59 // +-- v6 | 59 // +-- v6 |
| 60 // +-- v7 | 60 // +-- v7 |
| 61 // +-- v8 | 61 // +-- v8 |
| 62 // +-- v9 | 62 // +-- v9 |
| 63 TEST_F(ViewAuraTest, RecreateLayersWithWindows) { | 63 TEST_F(ViewAuraTest, RecreateLayersWithWindows) { |
| 64 // TODO: test uses GetContext(), which is not applicable to aura-mus. |
| 65 // http://crbug.com/663809. |
| 66 if (IsAuraMusClient()) |
| 67 return; |
| 68 |
| 64 Widget* w1 = CreateControlWidget(GetContext(), gfx::Rect(0, 0, 100, 100)); | 69 Widget* w1 = CreateControlWidget(GetContext(), gfx::Rect(0, 0, 100, 100)); |
| 65 w1->GetNativeView()->layer()->set_name("w1"); | 70 w1->GetNativeView()->layer()->set_name("w1"); |
| 66 | 71 |
| 67 View* v2 = new View(); | 72 View* v2 = new View(); |
| 68 v2->SetBounds(0, 1, 100, 101); | 73 v2->SetBounds(0, 1, 100, 101); |
| 69 View* v3 = new View(); | 74 View* v3 = new View(); |
| 70 v3->SetBounds(0, 2, 100, 102); | 75 v3->SetBounds(0, 2, 100, 102); |
| 71 View* w2_host_view = new View(); | 76 View* w2_host_view = new View(); |
| 72 | 77 |
| 73 View* v1 = CreateViewWithLayer(gfx::Rect(0, 3, 100, 103), "v1"); | 78 View* v1 = CreateViewWithLayer(gfx::Rect(0, 3, 100, 103), "v1"); |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 std::vector<ui::Layer*> new_w1_root_sublayers = w1->GetRootLayers(); | 178 std::vector<ui::Layer*> new_w1_root_sublayers = w1->GetRootLayers(); |
| 174 ASSERT_EQ(3u, new_w1_root_sublayers.size()); | 179 ASSERT_EQ(3u, new_w1_root_sublayers.size()); |
| 175 EXPECT_EQ(v1_new_layer, new_w1_root_sublayers[0]); | 180 EXPECT_EQ(v1_new_layer, new_w1_root_sublayers[0]); |
| 176 EXPECT_EQ(v4_new_layer, new_w1_root_sublayers[1]); | 181 EXPECT_EQ(v4_new_layer, new_w1_root_sublayers[1]); |
| 177 EXPECT_EQ(v7_new_layer, new_w1_root_sublayers[2]); | 182 EXPECT_EQ(v7_new_layer, new_w1_root_sublayers[2]); |
| 178 } | 183 } |
| 179 w1->CloseNow(); | 184 w1->CloseNow(); |
| 180 } | 185 } |
| 181 | 186 |
| 182 } // namespace views | 187 } // namespace views |
| OLD | NEW |