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

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

Issue 598013003: Added views::ViewModelT<T>, a type-safe template version of ViewModel. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@appsgridview-static-casts
Patch Set: DISALLOW_COPY_AND_ASSIGN. Created 6 years, 2 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
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/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/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 29 matching lines...) Expand all
40 40
41 void CloseBrowser(Browser* browser) { 41 void CloseBrowser(Browser* browser) {
42 browser->window()->Close(); 42 browser->window()->Close();
43 base::MessageLoop::current()->RunUntilIdle(); 43 base::MessageLoop::current()->RunUntilIdle();
44 } 44 }
45 45
46 gfx::Rect GetChromeIconBoundsForRootWindow(aura::Window* root_window) { 46 gfx::Rect GetChromeIconBoundsForRootWindow(aura::Window* root_window) {
47 ash::Shelf* shelf = ash::Shelf::ForWindow(root_window); 47 ash::Shelf* shelf = ash::Shelf::ForWindow(root_window);
48 const ash::ShelfView* shelf_view = 48 const ash::ShelfView* shelf_view =
49 ash::test::ShelfTestAPI(shelf).shelf_view(); 49 ash::test::ShelfTestAPI(shelf).shelf_view();
50 const views::ViewModel* view_model = shelf_view->view_model_for_test(); 50 const views::ViewModel<views::View>* view_model =
51 shelf_view->view_model_for_test();
51 52
52 EXPECT_EQ(2, view_model->view_size()); 53 EXPECT_EQ(2, view_model->view_size());
53 return view_model->view_at(1)->GetBoundsInScreen(); 54 return view_model->view_at(1)->GetBoundsInScreen();
54 } 55 }
55 56
56 void OpenBrowserUsingShelfOnRootWindow(aura::Window* root_window) { 57 void OpenBrowserUsingShelfOnRootWindow(aura::Window* root_window) {
57 ui::test::EventGenerator generator(root_window); 58 ui::test::EventGenerator generator(root_window);
58 gfx::Point center = 59 gfx::Point center =
59 GetChromeIconBoundsForRootWindow(root_window).CenterPoint(); 60 GetChromeIconBoundsForRootWindow(root_window).CenterPoint();
60 gfx::Display display = 61 gfx::Display display =
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 192
192 // Next new browser must be created on 1st display. 193 // Next new browser must be created on 1st display.
193 ASSERT_EQ(2u, browser_list->size()); 194 ASSERT_EQ(2u, browser_list->size());
194 EXPECT_EQ(root_windows[0], 195 EXPECT_EQ(root_windows[0],
195 browser_list->get(1)->window()->GetNativeWindow()->GetRootWindow()); 196 browser_list->get(1)->window()->GetNativeWindow()->GetRootWindow());
196 EXPECT_EQ(root_windows[0], ash::Shell::GetTargetRootWindow()); 197 EXPECT_EQ(root_windows[0], ash::Shell::GetTargetRootWindow());
197 198
198 // Balanced with the chrome::IncrementKeepAliveCount above. 199 // Balanced with the chrome::IncrementKeepAliveCount above.
199 chrome::DecrementKeepAliveCount(); 200 chrome::DecrementKeepAliveCount();
200 } 201 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698