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 "ash/shelf/shelf.h" | 5 #include "ash/shelf/shelf.h" |
6 #include "ash/shelf/shelf_view.h" | 6 #include "ash/shelf/shelf_view.h" |
7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
8 #include "ash/test/shelf_test_api.h" | 8 #include "ash/test/shelf_test_api.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 | 54 |
55 EXPECT_EQ(2, view_model->view_size()); | 55 EXPECT_EQ(2, view_model->view_size()); |
56 return view_model->view_at(1)->GetBoundsInScreen(); | 56 return view_model->view_at(1)->GetBoundsInScreen(); |
57 } | 57 } |
58 | 58 |
59 void OpenBrowserUsingShelfOnRootWindow(aura::Window* root_window) { | 59 void OpenBrowserUsingShelfOnRootWindow(aura::Window* root_window) { |
60 ui::test::EventGenerator generator(root_window); | 60 ui::test::EventGenerator generator(root_window); |
61 gfx::Point center = | 61 gfx::Point center = |
62 GetChromeIconBoundsForRootWindow(root_window).CenterPoint(); | 62 GetChromeIconBoundsForRootWindow(root_window).CenterPoint(); |
63 gfx::Display display = | 63 gfx::Display display = |
64 ash::Shell::GetScreen()->GetDisplayNearestWindow(root_window); | 64 gfx::Screen::GetScreen()->GetDisplayNearestWindow(root_window); |
65 const gfx::Point& origin = display.bounds().origin(); | 65 const gfx::Point& origin = display.bounds().origin(); |
66 center.Offset(- origin.x(), - origin.y()); | 66 center.Offset(- origin.x(), - origin.y()); |
67 generator.MoveMouseTo(center); | 67 generator.MoveMouseTo(center); |
68 generator.ClickLeftButton(); | 68 generator.ClickLeftButton(); |
69 } | 69 } |
70 | 70 |
71 } // namespace | 71 } // namespace |
72 | 72 |
73 #if !defined(OS_CHROMEOS) | 73 #if !defined(OS_CHROMEOS) |
74 #define MAYBE_OpenBrowserUsingShelfOnOtherDisplay DISABLED_OpenBrowserUsingShelf
OnOtherDisplay | 74 #define MAYBE_OpenBrowserUsingShelfOnOtherDisplay \ |
75 #define MAYBE_OpenBrowserUsingContextMenuOnOtherDisplay DISABLED_OpenBrowserUsin
gContextMenuOnOtherDisplay | 75 DISABLED_OpenBrowserUsingShelfOnOtherDisplay |
| 76 #define MAYBE_OpenBrowserUsingContextMenuOnOtherDisplay \ |
| 77 DISABLED_OpenBrowserUsingContextMenuOnOtherDisplay |
76 #else | 78 #else |
77 #define MAYBE_OpenBrowserUsingShelfOnOtherDisplay OpenBrowserUsingShelfOnOtherDi
splay | 79 #define MAYBE_OpenBrowserUsingShelfOnOtherDisplay \ |
78 #define MAYBE_OpenBrowserUsingContextMenuOnOtherDisplay OpenBrowserUsingContextM
enuOnOtherDisplay | 80 OpenBrowserUsingShelfOnOtherDisplay |
| 81 #define MAYBE_OpenBrowserUsingContextMenuOnOtherDisplay \ |
| 82 OpenBrowserUsingContextMenuOnOtherDisplay |
79 #endif | 83 #endif |
80 | 84 |
81 IN_PROC_BROWSER_TEST_F(WindowSizerTest, | 85 IN_PROC_BROWSER_TEST_F(WindowSizerTest, |
82 MAYBE_OpenBrowserUsingShelfOnOtherDisplay) { | 86 MAYBE_OpenBrowserUsingShelfOnOtherDisplay) { |
83 // Don't shutdown when closing the last browser window. | 87 // Don't shutdown when closing the last browser window. |
84 chrome::IncrementKeepAliveCount(); | 88 chrome::IncrementKeepAliveCount(); |
85 | 89 |
86 aura::Window::Windows root_windows = ash::Shell::GetAllRootWindows(); | 90 aura::Window::Windows root_windows = ash::Shell::GetAllRootWindows(); |
87 | 91 |
88 BrowserList* browser_list = | 92 BrowserList* browser_list = |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 | 197 |
194 // Next new browser must be created on 1st display. | 198 // Next new browser must be created on 1st display. |
195 ASSERT_EQ(2u, browser_list->size()); | 199 ASSERT_EQ(2u, browser_list->size()); |
196 EXPECT_EQ(root_windows[0], | 200 EXPECT_EQ(root_windows[0], |
197 browser_list->get(1)->window()->GetNativeWindow()->GetRootWindow()); | 201 browser_list->get(1)->window()->GetNativeWindow()->GetRootWindow()); |
198 EXPECT_EQ(root_windows[0], ash::Shell::GetTargetRootWindow()); | 202 EXPECT_EQ(root_windows[0], ash::Shell::GetTargetRootWindow()); |
199 | 203 |
200 // Balanced with the chrome::IncrementKeepAliveCount above. | 204 // Balanced with the chrome::IncrementKeepAliveCount above. |
201 chrome::DecrementKeepAliveCount(); | 205 chrome::DecrementKeepAliveCount(); |
202 } | 206 } |
OLD | NEW |