Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(182)

Unified Diff: ui/aura/window_unittest.cc

Issue 15114002: Reorder the NativeViews attached to a view via kViewHostKey according to the position of the view (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/aura/window_unittest.cc
diff --git a/ui/aura/window_unittest.cc b/ui/aura/window_unittest.cc
index a38ab014e6828f4153ced12fadcb5c3dddc13673..0991080496a6620701fab14cb0d139d24e909874 100644
--- a/ui/aura/window_unittest.cc
+++ b/ui/aura/window_unittest.cc
@@ -2057,6 +2057,21 @@ TEST_F(WindowTest, RecreateLayer) {
EXPECT_TRUE(layer->GetMasksToBounds());
}
+// Verify that RecreateLayer() stacks the old layer above the newly creatd
+// layer.
+TEST_F(WindowTest, RecreateLayerZOrder) {
+ scoped_ptr<Window> w(
+ CreateTestWindow(SK_ColorWHITE, 1, gfx::Rect(0, 0, 100, 100),
+ root_window()));
+ scoped_ptr<ui::Layer> old_layer(w->RecreateLayer());
+
+ const std::vector<ui::Layer*>& child_layers =
+ root_window()->layer()->children();
+ ASSERT_EQ(2u, child_layers.size());
+ EXPECT_EQ(w->layer(), child_layers[0]);
+ EXPECT_EQ(old_layer.get(), child_layers[1]);
+}
+
// Ensure that acquiring a layer then recreating a layer does not crash
// and that RecreateLayer returns null.
TEST_F(WindowTest, AcquireThenRecreateLayer) {

Powered by Google App Engine
This is Rietveld 408576698