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

Unified Diff: ash/content/keyboard_overlay/keyboard_overlay_delegate_unittest.cc

Issue 2461053002: Center Keyboard Overlay in the work area (Closed)
Patch Set: Fix tests Created 4 years, 2 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 | « ash/content/keyboard_overlay/keyboard_overlay_delegate.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/content/keyboard_overlay/keyboard_overlay_delegate_unittest.cc
diff --git a/ash/content/keyboard_overlay/keyboard_overlay_delegate_unittest.cc b/ash/content/keyboard_overlay/keyboard_overlay_delegate_unittest.cc
index 28b23d5f98ed35442f49f76c3c092ba251f1aafe..0279a436fcc35d32b2a4346036fa61cba0b0947e 100644
--- a/ash/content/keyboard_overlay/keyboard_overlay_delegate_unittest.cc
+++ b/ash/content/keyboard_overlay/keyboard_overlay_delegate_unittest.cc
@@ -40,25 +40,26 @@ TEST_P(KeyboardOverlayDelegateTest, ShowAndClose) {
KeyboardOverlayDelegate delegate(base::ASCIIToUTF16("Title"),
GURL("chrome://keyboardoverlay/"));
// Showing the dialog creates a widget.
- views::Widget* widget = delegate.Show(NULL);
+ views::Widget* widget = delegate.Show(nullptr);
EXPECT_TRUE(widget);
// The widget is on the primary root window.
EXPECT_EQ(Shell::GetPrimaryRootWindow(),
widget->GetNativeWindow()->GetRootWindow());
- // The widget is horizontally centered at the bottom of the work area.
+ // The widget is horizontally and vertically centered in the work area.
gfx::Rect work_area =
display::Screen::GetScreen()->GetPrimaryDisplay().work_area();
gfx::Rect bounds = widget->GetRestoredBounds();
EXPECT_EQ(work_area.CenterPoint().x(), bounds.CenterPoint().x());
- EXPECT_EQ(work_area.bottom(), bounds.bottom());
+ EXPECT_EQ(work_area.y() + (work_area.height() - bounds.height()) / 2,
+ bounds.y());
// Clean up.
widget->CloseNow();
}
-// Tests run three times - for all possible values of shelf alignment
+// Tests run four times - for all possible values of shelf alignment
INSTANTIATE_TEST_CASE_P(ShelfAlignmentAny,
KeyboardOverlayDelegateTest,
testing::Values(SHELF_ALIGNMENT_BOTTOM,
« no previous file with comments | « ash/content/keyboard_overlay/keyboard_overlay_delegate.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698