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

Unified Diff: chrome/browser/ui/views/app_list/linux/app_list_linux_unittest.cc

Issue 253983002: Use centered app list position whenever virtual keyboard is enabled. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed ExampleAppListViewDelegate (caused tree to close). Created 6 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
Index: chrome/browser/ui/views/app_list/linux/app_list_linux_unittest.cc
diff --git a/chrome/browser/ui/views/app_list/linux/app_list_linux_unittest.cc b/chrome/browser/ui/views/app_list/linux/app_list_linux_unittest.cc
index aa4c871811313d90e08d0cd8d26269d4494a0663..beafb903eec2a1b319fadf311da4589337b64ca3 100644
--- a/chrome/browser/ui/views/app_list/linux/app_list_linux_unittest.cc
+++ b/chrome/browser/ui/views/app_list/linux/app_list_linux_unittest.cc
@@ -53,6 +53,7 @@ class AppListLinuxUnitTest : public testing::Test {
display_.set_work_area(
gfx::Rect(0, kMenuBarSize, kScreenWidth, kScreenHeight - kMenuBarSize));
cursor_ = gfx::Point();
+ center_window_ = false;
}
// Set the display work area.
@@ -101,6 +102,10 @@ class AppListLinuxUnitTest : public testing::Test {
cursor_ = gfx::Point(x, y);
}
+ void EnableWindowCentering() {
+ center_window_ = true;
+ }
+
AppListPositioner::ScreenEdge ShelfEdge() const {
return AppListLinux::ShelfLocationInDisplay(display_);
}
@@ -109,12 +114,14 @@ class AppListLinuxUnitTest : public testing::Test {
return AppListLinux::FindAnchorPoint(gfx::Size(kWindowWidth, kWindowHeight),
display_,
cursor_,
- ShelfEdge());
+ ShelfEdge(),
+ center_window_);
}
private:
gfx::Display display_;
gfx::Point cursor_;
+ bool center_window_;
};
TEST_F(AppListLinuxUnitTest, ShelfLocationInDisplay) {
@@ -240,3 +247,13 @@ TEST_F(AppListLinuxUnitTest, FindAnchorPointMouseOnShelf) {
kScreenHeight - kShelfSize - kWindowHeight / 2),
DoFindAnchorPoint());
}
+
+TEST_F(AppListLinuxUnitTest, FindAnchorPointCentered) {
+ // Cursor on the top shelf; enable centered app list mode.
+ PlaceShelf(AppListPositioner::SCREEN_EDGE_TOP);
+ PlaceCursor(0, 0);
+ EnableWindowCentering();
+ // Expect the app list to be in the center of the screen (ignore the cursor).
+ EXPECT_EQ(gfx::Point(kScreenWidth / 2, kScreenHeight / 2),
+ DoFindAnchorPoint());
+}
« no previous file with comments | « chrome/browser/ui/views/app_list/linux/app_list_linux.cc ('k') | chrome/browser/ui/views/app_list/win/app_list_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698