| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "ui/aura/window.h" | 5 #include "ui/aura/window.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <utility> | 8 #include <utility> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 1953 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1964 ui::Layer child_layer; | 1964 ui::Layer child_layer; |
| 1965 layer->Add(&child_layer); | 1965 layer->Add(&child_layer); |
| 1966 | 1966 |
| 1967 scoped_ptr<ui::Layer> old_layer(w.RecreateLayer()); | 1967 scoped_ptr<ui::Layer> old_layer(w.RecreateLayer()); |
| 1968 layer = w.layer(); | 1968 layer = w.layer(); |
| 1969 EXPECT_EQ(ui::LAYER_SOLID_COLOR, layer->type()); | 1969 EXPECT_EQ(ui::LAYER_SOLID_COLOR, layer->type()); |
| 1970 EXPECT_FALSE(layer->scale_content()); | 1970 EXPECT_FALSE(layer->scale_content()); |
| 1971 EXPECT_FALSE(layer->visible()); | 1971 EXPECT_FALSE(layer->visible()); |
| 1972 EXPECT_EQ(1u, layer->children().size()); | 1972 EXPECT_EQ(1u, layer->children().size()); |
| 1973 EXPECT_TRUE(layer->GetMasksToBounds()); | 1973 EXPECT_TRUE(layer->GetMasksToBounds()); |
| 1974 // On recreate it's expected the bounds of both the window and layer go to |
| 1975 // 0. See description of Window::RecreateLayer() for details. |
| 1976 EXPECT_EQ("0,0 0x0", w.bounds().ToString()); |
| 1977 EXPECT_EQ("0,0 0x0", layer->bounds().ToString()); |
| 1974 } | 1978 } |
| 1975 | 1979 |
| 1976 // Verify that RecreateLayer() stacks the old layer above the newly creatd | 1980 // Verify that RecreateLayer() stacks the old layer above the newly creatd |
| 1977 // layer. | 1981 // layer. |
| 1978 TEST_F(WindowTest, RecreateLayerZOrder) { | 1982 TEST_F(WindowTest, RecreateLayerZOrder) { |
| 1979 scoped_ptr<Window> w( | 1983 scoped_ptr<Window> w( |
| 1980 CreateTestWindow(SK_ColorWHITE, 1, gfx::Rect(0, 0, 100, 100), | 1984 CreateTestWindow(SK_ColorWHITE, 1, gfx::Rect(0, 0, 100, 100), |
| 1981 root_window())); | 1985 root_window())); |
| 1982 scoped_ptr<ui::Layer> old_layer(w->RecreateLayer()); | 1986 scoped_ptr<ui::Layer> old_layer(w->RecreateLayer()); |
| 1983 | 1987 |
| (...skipping 1352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3336 BuildRootLayerTreeDescription(*root.layer())) | 3340 BuildRootLayerTreeDescription(*root.layer())) |
| 3337 << "layer tree doesn't match at " << i; | 3341 << "layer tree doesn't match at " << i; |
| 3338 EXPECT_EQ(data[i].expected_description, | 3342 EXPECT_EQ(data[i].expected_description, |
| 3339 BuildRootWindowTreeDescription(root)) | 3343 BuildRootWindowTreeDescription(root)) |
| 3340 << "window tree doesn't match at " << i; | 3344 << "window tree doesn't match at " << i; |
| 3341 } | 3345 } |
| 3342 } | 3346 } |
| 3343 | 3347 |
| 3344 } // namespace test | 3348 } // namespace test |
| 3345 } // namespace aura | 3349 } // namespace aura |
| OLD | NEW |