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

Side by Side Diff: ui/views/widget/native_widget_aura_unittest.cc

Issue 2639203007: Update SetPaintToLayer to accept LayerType (Closed)
Patch Set: fix 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/widget/native_widget_aura.h" 5 #include "ui/views/widget/native_widget_aura.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after
478 478
479 // Point is over |child|. 479 // Point is over |child|.
480 EXPECT_EQ(child->GetNativeWindow(), 480 EXPECT_EQ(child->GetNativeWindow(),
481 parent->GetNativeWindow()->GetEventHandlerForPoint( 481 parent->GetNativeWindow()->GetEventHandlerForPoint(
482 gfx::Point(50, 50))); 482 gfx::Point(50, 50)));
483 483
484 // Create a view with a layer and stack it at the bottom (below |child|). 484 // Create a view with a layer and stack it at the bottom (below |child|).
485 views::View* view_with_layer = new views::View; 485 views::View* view_with_layer = new views::View;
486 parent_root->AddChildView(view_with_layer); 486 parent_root->AddChildView(view_with_layer);
487 view_with_layer->SetBounds(0, 0, 50, 50); 487 view_with_layer->SetBounds(0, 0, 50, 50);
488 view_with_layer->SetPaintToLayer(true); 488 view_with_layer->SetPaintToLayer();
489 489
490 // Make sure that |child| still gets the event. 490 // Make sure that |child| still gets the event.
491 EXPECT_EQ(child->GetNativeWindow(), 491 EXPECT_EQ(child->GetNativeWindow(),
492 parent->GetNativeWindow()->GetEventHandlerForPoint( 492 parent->GetNativeWindow()->GetEventHandlerForPoint(
493 gfx::Point(20, 20))); 493 gfx::Point(20, 20)));
494 494
495 // Move |view_with_layer| to the top and make sure it gets the 495 // Move |view_with_layer| to the top and make sure it gets the
496 // event when the point is within |view_with_layer|'s bounds. 496 // event when the point is within |view_with_layer|'s bounds.
497 view_with_layer->layer()->parent()->StackAtTop( 497 view_with_layer->layer()->parent()->StackAtTop(
498 view_with_layer->layer()); 498 view_with_layer->layer());
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
597 EXPECT_FALSE(delegate.view()->HasFocus()); 597 EXPECT_FALSE(delegate.view()->HasFocus());
598 598
599 test_focus_rules()->set_can_activate(true); 599 test_focus_rules()->set_can_activate(true);
600 views::test::TestInitialFocusWidgetDelegate delegate2(root_window()); 600 views::test::TestInitialFocusWidgetDelegate delegate2(root_window());
601 delegate2.GetWidget()->Show(); 601 delegate2.GetWidget()->Show();
602 EXPECT_TRUE(delegate2.view()->HasFocus()); 602 EXPECT_TRUE(delegate2.view()->HasFocus());
603 } 603 }
604 604
605 } // namespace 605 } // namespace
606 } // namespace views 606 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698