| 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_view.h" | 5 #include "ash/shelf/shelf_view.h" |
| 6 #include "ash/shelf/wm_shelf.h" | 6 #include "ash/shelf/wm_shelf.h" |
| 7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
| 8 #include "ash/wm_window.h" | 8 #include "ash/wm_window.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/location.h" | 10 #include "base/location.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 DISALLOW_COPY_AND_ASSIGN(WindowSizerTest); | 47 DISALLOW_COPY_AND_ASSIGN(WindowSizerTest); |
| 48 }; | 48 }; |
| 49 | 49 |
| 50 void CloseBrowser(Browser* browser) { | 50 void CloseBrowser(Browser* browser) { |
| 51 browser->window()->Close(); | 51 browser->window()->Close(); |
| 52 base::RunLoop().RunUntilIdle(); | 52 base::RunLoop().RunUntilIdle(); |
| 53 } | 53 } |
| 54 | 54 |
| 55 gfx::Rect GetChromeIconBoundsForRootWindow(aura::Window* root_window) { | 55 gfx::Rect GetChromeIconBoundsForRootWindow(aura::Window* root_window) { |
| 56 const ash::ShelfView* shelf_view = | 56 const ash::ShelfView* shelf_view = |
| 57 ash::WmShelf::ForWindow(ash::WmWindow::Get(root_window)) | 57 ash::WmShelf::ForWindow(root_window)->GetShelfViewForTesting(); |
| 58 ->GetShelfViewForTesting(); | |
| 59 const views::ViewModel* view_model = shelf_view->view_model_for_test(); | 58 const views::ViewModel* view_model = shelf_view->view_model_for_test(); |
| 60 | 59 |
| 61 EXPECT_EQ(2, view_model->view_size()); | 60 EXPECT_EQ(2, view_model->view_size()); |
| 62 return view_model->view_at(1)->GetBoundsInScreen(); | 61 return view_model->view_at(1)->GetBoundsInScreen(); |
| 63 } | 62 } |
| 64 | 63 |
| 65 void OpenBrowserUsingShelfOnRootWindow(aura::Window* root_window) { | 64 void OpenBrowserUsingShelfOnRootWindow(aura::Window* root_window) { |
| 66 ui::test::EventGenerator generator(root_window); | 65 ui::test::EventGenerator generator(root_window); |
| 67 gfx::Point center = | 66 gfx::Point center = |
| 68 GetChromeIconBoundsForRootWindow(root_window).CenterPoint(); | 67 GetChromeIconBoundsForRootWindow(root_window).CenterPoint(); |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 | 198 |
| 200 CloseBrowser(browser_list->get(0)); | 199 CloseBrowser(browser_list->get(0)); |
| 201 OpenBrowserUsingContextMenuOnRootWindow(root_windows[0]); | 200 OpenBrowserUsingContextMenuOnRootWindow(root_windows[0]); |
| 202 | 201 |
| 203 // Next new browser must be created on 1st display. | 202 // Next new browser must be created on 1st display. |
| 204 ASSERT_EQ(1u, browser_list->size()); | 203 ASSERT_EQ(1u, browser_list->size()); |
| 205 EXPECT_EQ(root_windows[0], | 204 EXPECT_EQ(root_windows[0], |
| 206 browser_list->get(0)->window()->GetNativeWindow()->GetRootWindow()); | 205 browser_list->get(0)->window()->GetNativeWindow()->GetRootWindow()); |
| 207 EXPECT_EQ(root_windows[0], ash::Shell::GetRootWindowForNewWindows()); | 206 EXPECT_EQ(root_windows[0], ash::Shell::GetRootWindowForNewWindows()); |
| 208 } | 207 } |
| OLD | NEW |