| 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;
|
|
|
|
|