| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "chrome/browser/ui/views/app_list/linux/app_list_linux.h" | 5 #include "chrome/browser/ui/views/app_list/linux/app_list_linux.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "chrome/browser/ui/app_list/app_list_positioner.h" | 8 #include "chrome/browser/ui/app_list/app_list_positioner.h" |
| 9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
| 10 #include "ui/gfx/display.h" | 10 #include "ui/gfx/display.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 const int kWindowNearEdge = kWindowWidth / 4; | 41 const int kWindowNearEdge = kWindowWidth / 4; |
| 42 // A position for the center of the window that places the window away from all | 42 // A position for the center of the window that places the window away from all |
| 43 // edges of the screen. This must be > kWindowWidth / 2, > kWindowHeight / 2, < | 43 // edges of the screen. This must be > kWindowWidth / 2, > kWindowHeight / 2, < |
| 44 // kScreenWidth - kWindowWidth / 2 and < kScreenHeight - kWindowHeight / 2. | 44 // kScreenWidth - kWindowWidth / 2 and < kScreenHeight - kWindowHeight / 2. |
| 45 const int kWindowAwayFromEdge = 158; | 45 const int kWindowAwayFromEdge = 158; |
| 46 | 46 |
| 47 } // namespace | 47 } // namespace |
| 48 | 48 |
| 49 class AppListLinuxUnitTest : public testing::Test { | 49 class AppListLinuxUnitTest : public testing::Test { |
| 50 public: | 50 public: |
| 51 virtual void SetUp() OVERRIDE { | 51 virtual void SetUp() override { |
| 52 display_.set_bounds(gfx::Rect(0, 0, kScreenWidth, kScreenHeight)); | 52 display_.set_bounds(gfx::Rect(0, 0, kScreenWidth, kScreenHeight)); |
| 53 display_.set_work_area( | 53 display_.set_work_area( |
| 54 gfx::Rect(0, kMenuBarSize, kScreenWidth, kScreenHeight - kMenuBarSize)); | 54 gfx::Rect(0, kMenuBarSize, kScreenWidth, kScreenHeight - kMenuBarSize)); |
| 55 cursor_ = gfx::Point(); | 55 cursor_ = gfx::Point(); |
| 56 center_window_ = false; | 56 center_window_ = false; |
| 57 } | 57 } |
| 58 | 58 |
| 59 // Set the display work area. | 59 // Set the display work area. |
| 60 void SetWorkArea(int x, int y, int width, int height) { | 60 void SetWorkArea(int x, int y, int width, int height) { |
| 61 display_.set_work_area(gfx::Rect(x, y, width, height)); | 61 display_.set_work_area(gfx::Rect(x, y, width, height)); |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 | 250 |
| 251 TEST_F(AppListLinuxUnitTest, FindAnchorPointCentered) { | 251 TEST_F(AppListLinuxUnitTest, FindAnchorPointCentered) { |
| 252 // Cursor on the top shelf; enable centered app list mode. | 252 // Cursor on the top shelf; enable centered app list mode. |
| 253 PlaceShelf(AppListPositioner::SCREEN_EDGE_TOP); | 253 PlaceShelf(AppListPositioner::SCREEN_EDGE_TOP); |
| 254 PlaceCursor(0, 0); | 254 PlaceCursor(0, 0); |
| 255 EnableWindowCentering(); | 255 EnableWindowCentering(); |
| 256 // Expect the app list to be in the center of the screen (ignore the cursor). | 256 // Expect the app list to be in the center of the screen (ignore the cursor). |
| 257 EXPECT_EQ(gfx::Point(kScreenWidth / 2, kScreenHeight / 2), | 257 EXPECT_EQ(gfx::Point(kScreenWidth / 2, kScreenHeight / 2), |
| 258 DoFindAnchorPoint()); | 258 DoFindAnchorPoint()); |
| 259 } | 259 } |
| OLD | NEW |