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

Unified Diff: ui/views/view_unittest_aura.cc

Issue 2651753003: Wires up ShouldDescendIntoChildForEventHandling() for DesktopNativeWidgetAura (Closed)
Patch Set: improve comments Created 3 years, 11 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
« no previous file with comments | « ui/views/view.cc ('k') | ui/views/widget/desktop_aura/desktop_native_widget_aura.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/view_unittest_aura.cc
diff --git a/ui/views/view_unittest_aura.cc b/ui/views/view_unittest_aura.cc
index 351c662a951ab61d6f59a4bc1fd4f7a83a0bb9bb..231afc330878e832866805772f1317b2c5f2feeb 100644
--- a/ui/views/view_unittest_aura.cc
+++ b/ui/views/view_unittest_aura.cc
@@ -43,7 +43,18 @@ View* CreateViewWithLayer(const gfx::Rect& bounds, const char* layer_name) {
} // namespace
-typedef ViewsTestBase ViewAuraTest;
+class ViewAuraTest : public ViewsTestBase {
+ public:
+ ViewAuraTest() {}
+ ~ViewAuraTest() override {}
+
+ const View::Views& GetViewsWithLayers(Widget* widget) {
+ return widget->GetViewsWithLayers();
+ }
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ViewAuraTest);
+};
// Test that wm::RecreateLayers() recreates the layers for all child windows and
// all child views and that the z-order of the recreated layers matches that of
@@ -119,11 +130,11 @@ TEST_F(ViewAuraTest, RecreateLayersWithWindows) {
// Verify the value of Widget::GetRootLayers(). It should only include layers
// from layer-backed Views descended from the Widget's root View.
- std::vector<ui::Layer*> old_w1_root_sublayers = w1->GetRootLayers();
- ASSERT_EQ(3u, old_w1_root_sublayers.size());
- EXPECT_EQ(v1_layer, old_w1_root_sublayers[0]);
- EXPECT_EQ(v4_layer, old_w1_root_sublayers[1]);
- EXPECT_EQ(v7_layer, old_w1_root_sublayers[2]);
+ View::Views old_w1_views_with_layers = GetViewsWithLayers(w1);
+ ASSERT_EQ(3u, old_w1_views_with_layers.size());
+ EXPECT_EQ(v1, old_w1_views_with_layers[0]);
+ EXPECT_EQ(v4, old_w1_views_with_layers[1]);
+ EXPECT_EQ(v7, old_w1_views_with_layers[2]);
{
std::unique_ptr<ui::LayerTreeOwner> cloned_owner(
@@ -174,12 +185,12 @@ TEST_F(ViewAuraTest, RecreateLayersWithWindows) {
ASSERT_EQ("v8 v9", ui::test::ChildLayerNamesAsString(*v7_new_layer));
EXPECT_NE(v7_layer, v7_new_layer);
- // Ensure Widget::GetRootLayers() is correctly updated.
- std::vector<ui::Layer*> new_w1_root_sublayers = w1->GetRootLayers();
- ASSERT_EQ(3u, new_w1_root_sublayers.size());
- EXPECT_EQ(v1_new_layer, new_w1_root_sublayers[0]);
- EXPECT_EQ(v4_new_layer, new_w1_root_sublayers[1]);
- EXPECT_EQ(v7_new_layer, new_w1_root_sublayers[2]);
+ // Ensure Widget::GetViewsWithLayers() is correctly updated.
+ View::Views new_w1_views_with_layers = GetViewsWithLayers(w1);
+ ASSERT_EQ(3u, new_w1_views_with_layers.size());
+ EXPECT_EQ(v1, new_w1_views_with_layers[0]);
+ EXPECT_EQ(v4, new_w1_views_with_layers[1]);
+ EXPECT_EQ(v7, new_w1_views_with_layers[2]);
}
w1->CloseNow();
}
« no previous file with comments | « ui/views/view.cc ('k') | ui/views/widget/desktop_aura/desktop_native_widget_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698