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

Unified Diff: trunk/src/ui/views/widget/native_widget_aura_unittest.cc

Issue 16256004: Revert 203217 "Revert 202987 "Reorder the NativeViews attached t..." (Closed) Base URL: svn://svn.chromium.org/chrome/
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
« no previous file with comments | « trunk/src/ui/views/widget/native_widget_aura.cc ('k') | trunk/src/ui/views/widget/native_widget_private.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/src/ui/views/widget/native_widget_aura_unittest.cc
===================================================================
--- trunk/src/ui/views/widget/native_widget_aura_unittest.cc (revision 203401)
+++ trunk/src/ui/views/widget/native_widget_aura_unittest.cc (working copy)
@@ -315,8 +315,7 @@
// Verifies views with layers are targeted for events properly.
TEST_F(NativeWidgetAuraTest, PreferViewLayersToChildWindows) {
- // Create two widget, |parent_root| and |child|. |child| is a child of
- // |parent_root|.
+ // Create two widgets: |parent| and |child|. |child| is a child of |parent|.
views::View* parent_root = new views::View;
scoped_ptr<Widget> parent(new Widget());
Widget::InitParams parent_params(Widget::InitParams::TYPE_WINDOW_FRAMELESS);
@@ -341,13 +340,21 @@
parent->GetNativeWindow()->GetEventHandlerForPoint(
gfx::Point(50, 50)));
- // Create a view with a layer and stack it at the top (above |child|).
+ // Create a view with a layer and stack it at the bottom (below |child|).
views::View* view_with_layer = new views::View;
parent_root->AddChildView(view_with_layer);
view_with_layer->SetBounds(0, 0, 50, 50);
view_with_layer->SetPaintToLayer(true);
- // Point is over |view_with_layer|, it should get the event.
+ // Make sure that |child| still gets the event.
+ EXPECT_EQ(child->GetNativeWindow(),
+ parent->GetNativeWindow()->GetEventHandlerForPoint(
+ gfx::Point(20, 20)));
+
+ // Move |view_with_layer| to the top and make sure it gets the
+ // event when the point is within |view_with_layer|'s bounds.
+ view_with_layer->layer()->parent()->StackAtTop(
+ view_with_layer->layer());
EXPECT_EQ(parent->GetNativeWindow(),
parent->GetNativeWindow()->GetEventHandlerForPoint(
gfx::Point(20, 20)));
@@ -357,13 +364,6 @@
parent->GetNativeWindow()->GetEventHandlerForPoint(
gfx::Point(70, 70)));
- // Move |child| to the top and make sure it gets the event.
- child->GetNativeWindow()->layer()->parent()->StackAtTop(
- child->GetNativeWindow()->layer());
- EXPECT_EQ(child->GetNativeWindow(),
- parent->GetNativeWindow()->GetEventHandlerForPoint(
- gfx::Point(20, 20)));
-
delete view_with_layer;
view_with_layer = NULL;
« no previous file with comments | « trunk/src/ui/views/widget/native_widget_aura.cc ('k') | trunk/src/ui/views/widget/native_widget_private.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698