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

Side by Side Diff: ui/views/view_unittest_aura.cc

Issue 2639203007: Update SetPaintToLayer to accept LayerType (Closed)
Patch Set: fix comments Created 3 years, 10 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 unified diff | Download patch
OLDNEW
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 18 matching lines...) Expand all
29 Widget* widget = new Widget(); 29 Widget* widget = new Widget();
30 widget->Init(params); 30 widget->Init(params);
31 return widget; 31 return widget;
32 } 32 }
33 33
34 // Returns a view with a layer with the passed in |bounds| and |layer_name|. 34 // Returns a view with a layer with the passed in |bounds| and |layer_name|.
35 // The caller takes ownership of the returned view. 35 // The caller takes ownership of the returned view.
36 View* CreateViewWithLayer(const gfx::Rect& bounds, const char* layer_name) { 36 View* CreateViewWithLayer(const gfx::Rect& bounds, const char* layer_name) {
37 View* view = new View(); 37 View* view = new View();
38 view->SetBoundsRect(bounds); 38 view->SetBoundsRect(bounds);
39 view->SetPaintToLayer(true); 39 view->SetPaintToLayer();
40 view->layer()->set_name(layer_name); 40 view->layer()->set_name(layer_name);
41 return view; 41 return view;
42 } 42 }
43 43
44 } // namespace 44 } // namespace
45 45
46 typedef ViewsTestBase ViewAuraTest; 46 typedef ViewsTestBase ViewAuraTest;
47 47
48 // Test that wm::RecreateLayers() recreates the layers for all child windows and 48 // Test that wm::RecreateLayers() recreates the layers for all child windows and
49 // all child views and that the z-order of the recreated layers matches that of 49 // all child views and that the z-order of the recreated layers matches that of
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 std::vector<ui::Layer*> new_w1_root_sublayers = w1->GetRootLayers(); 178 std::vector<ui::Layer*> new_w1_root_sublayers = w1->GetRootLayers();
179 ASSERT_EQ(3u, new_w1_root_sublayers.size()); 179 ASSERT_EQ(3u, new_w1_root_sublayers.size());
180 EXPECT_EQ(v1_new_layer, new_w1_root_sublayers[0]); 180 EXPECT_EQ(v1_new_layer, new_w1_root_sublayers[0]);
181 EXPECT_EQ(v4_new_layer, new_w1_root_sublayers[1]); 181 EXPECT_EQ(v4_new_layer, new_w1_root_sublayers[1]);
182 EXPECT_EQ(v7_new_layer, new_w1_root_sublayers[2]); 182 EXPECT_EQ(v7_new_layer, new_w1_root_sublayers[2]);
183 } 183 }
184 w1->CloseNow(); 184 w1->CloseNow();
185 } 185 }
186 186
187 } // namespace views 187 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698