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/win/app_list_win.h" | 5 #include "chrome/browser/ui/views/app_list/win/app_list_win.h" |
6 | 6 |
7 #include "chrome/browser/ui/app_list/app_list_positioner.h" | 7 #include "chrome/browser/ui/app_list/app_list_positioner.h" |
8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
9 #include "ui/gfx/display.h" | 9 #include "ui/gfx/display.h" |
10 #include "ui/gfx/point.h" | 10 #include "ui/gfx/point.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 // kScreenWidth - kWindowWidth / 2 and < kScreenHeight - kWindowHeight / 2. | 42 // kScreenWidth - kWindowWidth / 2 and < kScreenHeight - kWindowHeight / 2. |
43 const int kWindowAwayFromEdge = 158; | 43 const int kWindowAwayFromEdge = 158; |
44 | 44 |
45 // Horizontal offset of the simulated Windows 8 split point. | 45 // Horizontal offset of the simulated Windows 8 split point. |
46 const int kWin8SplitPoint = 200; | 46 const int kWin8SplitPoint = 200; |
47 | 47 |
48 } // namespace | 48 } // namespace |
49 | 49 |
50 class AppListWinUnitTest : public testing::Test { | 50 class AppListWinUnitTest : public testing::Test { |
51 public: | 51 public: |
52 virtual void SetUp() OVERRIDE { | 52 virtual void SetUp() override { |
53 display_.set_bounds(gfx::Rect(0, 0, kScreenWidth, kScreenHeight)); | 53 display_.set_bounds(gfx::Rect(0, 0, kScreenWidth, kScreenHeight)); |
54 display_.set_work_area(gfx::Rect(0, 0, kScreenWidth, kScreenHeight)); | 54 display_.set_work_area(gfx::Rect(0, 0, kScreenWidth, kScreenHeight)); |
55 cursor_ = gfx::Point(); | 55 cursor_ = gfx::Point(); |
56 taskbar_rect_ = gfx::Rect(); | 56 taskbar_rect_ = gfx::Rect(); |
57 center_window_ = false; | 57 center_window_ = false; |
58 } | 58 } |
59 | 59 |
60 // Set the display work area. | 60 // Set the display work area. |
61 void SetWorkArea(int x, int y, int width, int height) { | 61 void SetWorkArea(int x, int y, int width, int height) { |
62 display_.set_work_area(gfx::Rect(x, y, width, height)); | 62 display_.set_work_area(gfx::Rect(x, y, width, height)); |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 | 252 |
253 TEST_F(AppListWinUnitTest, FindAnchorPointCentered) { | 253 TEST_F(AppListWinUnitTest, FindAnchorPointCentered) { |
254 // Cursor on the top taskbar; enable centered app list mode. | 254 // Cursor on the top taskbar; enable centered app list mode. |
255 PlaceTaskbar(AppListPositioner::SCREEN_EDGE_TOP); | 255 PlaceTaskbar(AppListPositioner::SCREEN_EDGE_TOP); |
256 PlaceCursor(0, 0); | 256 PlaceCursor(0, 0); |
257 EnableWindowCentering(); | 257 EnableWindowCentering(); |
258 // Expect the app list to be in the center of the screen (ignore the cursor). | 258 // Expect the app list to be in the center of the screen (ignore the cursor). |
259 EXPECT_EQ(gfx::Point(kScreenWidth / 2, kScreenHeight / 2), | 259 EXPECT_EQ(gfx::Point(kScreenWidth / 2, kScreenHeight / 2), |
260 DoFindAnchorPoint()); | 260 DoFindAnchorPoint()); |
261 } | 261 } |
OLD | NEW |