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

Side by Side Diff: chrome/browser/ui/window_sizer/window_sizer_ash_uitest.cc

Issue 2237903003: mash: Migrate Shelf aura::Window uses to WmWindow. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move shelf notify functions to WmShell. Created 4 years, 4 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/ui/ash/shelf_browsertest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/aura/wm_window_aura.h"
5 #include "ash/common/shelf/shelf_view.h" 6 #include "ash/common/shelf/shelf_view.h"
6 #include "ash/shelf/shelf.h" 7 #include "ash/shelf/shelf.h"
7 #include "ash/shell.h" 8 #include "ash/shell.h"
8 #include "ash/test/shelf_test_api.h" 9 #include "ash/test/shelf_test_api.h"
9 #include "base/command_line.h" 10 #include "base/command_line.h"
10 #include "base/location.h" 11 #include "base/location.h"
11 #include "base/macros.h" 12 #include "base/macros.h"
12 #include "base/message_loop/message_loop.h" 13 #include "base/message_loop/message_loop.h"
13 #include "base/run_loop.h" 14 #include "base/run_loop.h"
14 #include "base/single_thread_task_runner.h" 15 #include "base/single_thread_task_runner.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 private: 47 private:
47 DISALLOW_COPY_AND_ASSIGN(WindowSizerTest); 48 DISALLOW_COPY_AND_ASSIGN(WindowSizerTest);
48 }; 49 };
49 50
50 void CloseBrowser(Browser* browser) { 51 void CloseBrowser(Browser* browser) {
51 browser->window()->Close(); 52 browser->window()->Close();
52 base::RunLoop().RunUntilIdle(); 53 base::RunLoop().RunUntilIdle();
53 } 54 }
54 55
55 gfx::Rect GetChromeIconBoundsForRootWindow(aura::Window* root_window) { 56 gfx::Rect GetChromeIconBoundsForRootWindow(aura::Window* root_window) {
56 ash::Shelf* shelf = ash::Shelf::ForWindow(root_window); 57 ash::Shelf* shelf =
58 ash::Shelf::ForWindow(ash::WmWindowAura::Get(root_window));
57 const ash::ShelfView* shelf_view = 59 const ash::ShelfView* shelf_view =
58 ash::test::ShelfTestAPI(shelf).shelf_view(); 60 ash::test::ShelfTestAPI(shelf).shelf_view();
59 const views::ViewModel* view_model = shelf_view->view_model_for_test(); 61 const views::ViewModel* view_model = shelf_view->view_model_for_test();
60 62
61 EXPECT_EQ(2, view_model->view_size()); 63 EXPECT_EQ(2, view_model->view_size());
62 return view_model->view_at(1)->GetBoundsInScreen(); 64 return view_model->view_at(1)->GetBoundsInScreen();
63 } 65 }
64 66
65 void OpenBrowserUsingShelfOnRootWindow(aura::Window* root_window) { 67 void OpenBrowserUsingShelfOnRootWindow(aura::Window* root_window) {
66 ui::test::EventGenerator generator(root_window); 68 ui::test::EventGenerator generator(root_window);
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 200
199 CloseBrowser(browser_list->get(0)); 201 CloseBrowser(browser_list->get(0));
200 OpenBrowserUsingContextMenuOnRootWindow(root_windows[0]); 202 OpenBrowserUsingContextMenuOnRootWindow(root_windows[0]);
201 203
202 // Next new browser must be created on 1st display. 204 // Next new browser must be created on 1st display.
203 ASSERT_EQ(1u, browser_list->size()); 205 ASSERT_EQ(1u, browser_list->size());
204 EXPECT_EQ(root_windows[0], 206 EXPECT_EQ(root_windows[0],
205 browser_list->get(0)->window()->GetNativeWindow()->GetRootWindow()); 207 browser_list->get(0)->window()->GetNativeWindow()->GetRootWindow());
206 EXPECT_EQ(root_windows[0], ash::Shell::GetTargetRootWindow()); 208 EXPECT_EQ(root_windows[0], ash::Shell::GetTargetRootWindow());
207 } 209 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/ash/shelf_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698