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

Unified Diff: ui/views/controls/button/custom_button_unittest.cc

Issue 2010083002: views/mus: Run some more tests from views_unittests in mus. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 6 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/accessible_pane_view_unittest.cc ('k') | ui/views/controls/button/label_button_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/button/custom_button_unittest.cc
diff --git a/ui/views/controls/button/custom_button_unittest.cc b/ui/views/controls/button/custom_button_unittest.cc
index 02fbd456692b730137b6a2edf79c1608868baa05..b9ca9712d47bf29654fae6782f5c7d26a4ee4d2b 100644
--- a/ui/views/controls/button/custom_button_unittest.cc
+++ b/ui/views/controls/button/custom_button_unittest.cc
@@ -140,7 +140,7 @@ class CustomButtonTest : public ViewsTestBase {
// Tests that hover state changes correctly when visiblity/enableness changes.
TEST_F(CustomButtonTest, HoverStateOnVisibilityChange) {
- ui::test::EventGenerator generator(GetContext(), widget()->GetNativeWindow());
+ ui::test::EventGenerator generator(widget()->GetNativeWindow());
generator.PressLeftButton();
EXPECT_EQ(CustomButton::STATE_PRESSED, button()->state());
@@ -192,21 +192,24 @@ TEST_F(CustomButtonTest, HoverStateOnVisibilityChange) {
aura::test::TestCursorClient cursor_client(
widget()->GetNativeView()->GetRootWindow());
- // In Aura views, no new hover effects are invoked if mouse events
- // are disabled.
- cursor_client.DisableMouseEvents();
+ // Mus doesn't support disabling mouse events. https://crbug.com/618321
+ if (!IsMus()) {
+ // In Aura views, no new hover effects are invoked if mouse events
+ // are disabled.
+ cursor_client.DisableMouseEvents();
- button()->SetEnabled(false);
- EXPECT_EQ(CustomButton::STATE_DISABLED, button()->state());
+ button()->SetEnabled(false);
+ EXPECT_EQ(CustomButton::STATE_DISABLED, button()->state());
- button()->SetEnabled(true);
- EXPECT_EQ(CustomButton::STATE_NORMAL, button()->state());
+ button()->SetEnabled(true);
+ EXPECT_EQ(CustomButton::STATE_NORMAL, button()->state());
- button()->SetVisible(false);
- EXPECT_EQ(CustomButton::STATE_NORMAL, button()->state());
+ button()->SetVisible(false);
+ EXPECT_EQ(CustomButton::STATE_NORMAL, button()->state());
- button()->SetVisible(true);
- EXPECT_EQ(CustomButton::STATE_NORMAL, button()->state());
+ button()->SetVisible(true);
+ EXPECT_EQ(CustomButton::STATE_NORMAL, button()->state());
+ }
#endif // !defined(OS_MACOSX) || defined(USE_AURA)
}
@@ -349,7 +352,7 @@ TEST_F(CustomButtonTest, ButtonClickTogglesInkDrop) {
TestInkDrop* ink_drop = new TestInkDrop();
CreateButtonWithInkDrop(base::WrapUnique(ink_drop));
- ui::test::EventGenerator generator(GetContext(), widget()->GetNativeWindow());
+ ui::test::EventGenerator generator(widget()->GetNativeWindow());
generator.set_current_location(gfx::Point(50, 50));
generator.PressLeftButton();
EXPECT_EQ(InkDropState::ACTION_PENDING, ink_drop->GetTargetInkDropState());
@@ -365,7 +368,7 @@ TEST_F(CustomButtonTest, CaptureLossHidesInkDrop) {
TestInkDrop* ink_drop = new TestInkDrop();
CreateButtonWithInkDrop(base::WrapUnique(ink_drop));
- ui::test::EventGenerator generator(GetContext(), widget()->GetNativeWindow());
+ ui::test::EventGenerator generator(widget()->GetNativeWindow());
generator.set_current_location(gfx::Point(50, 50));
generator.PressLeftButton();
EXPECT_EQ(InkDropState::ACTION_PENDING, ink_drop->GetTargetInkDropState());
« no previous file with comments | « ui/views/accessible_pane_view_unittest.cc ('k') | ui/views/controls/button/label_button_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698