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

Side by Side Diff: ui/app_list/views/app_list_main_view_unittest.cc

Issue 771063002: Rename AppListMainViewTest::ContentsView to AppListMainViewTest::GetContentsView to fix build break (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Renamed the method to contents_view() Created 6 years 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 | « no previous file | 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 "ui/app_list/views/app_list_main_view.h" 5 #include "ui/app_list/views/app_list_main_view.h"
6 6
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "base/run_loop.h" 8 #include "base/run_loop.h"
9 #include "base/time/time.h" 9 #include "base/time/time.h"
10 #include "base/timer/timer.h" 10 #include "base/timer/timer.h"
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 AppsGridView::Pointer pointer, 147 AppsGridView::Pointer pointer,
148 AppListItemView* drag_view, 148 AppListItemView* drag_view,
149 const gfx::Point& point) { 149 const gfx::Point& point) {
150 DCHECK(drag_view); 150 DCHECK(drag_view);
151 gfx::Point translated = 151 gfx::Point translated =
152 gfx::PointAtOffsetFromOrigin(point - drag_view->bounds().origin()); 152 gfx::PointAtOffsetFromOrigin(point - drag_view->bounds().origin());
153 ui::MouseEvent drag_event(ui::ET_MOUSE_DRAGGED, translated, point, 0, 0); 153 ui::MouseEvent drag_event(ui::ET_MOUSE_DRAGGED, translated, point, 0, 0);
154 grid_view->UpdateDragFromItem(pointer, drag_event); 154 grid_view->UpdateDragFromItem(pointer, drag_event);
155 } 155 }
156 156
157 ContentsView* ContentsView() { return main_view_->contents_view(); } 157 ContentsView* contents_view() { return main_view_->contents_view(); }
158 158
159 AppsGridView* RootGridView() { 159 AppsGridView* RootGridView() {
160 return ContentsView()->apps_container_view()->apps_grid_view(); 160 return contents_view()->apps_container_view()->apps_grid_view();
161 } 161 }
162 162
163 AppListFolderView* FolderView() { 163 AppListFolderView* FolderView() {
164 return ContentsView()->apps_container_view()->app_list_folder_view(); 164 return contents_view()->apps_container_view()->app_list_folder_view();
165 } 165 }
166 166
167 AppsGridView* FolderGridView() { return FolderView()->items_grid_view(); } 167 AppsGridView* FolderGridView() { return FolderView()->items_grid_view(); }
168 168
169 const views::ViewModelT<AppListItemView>* RootViewModel() { 169 const views::ViewModelT<AppListItemView>* RootViewModel() {
170 return RootGridView()->view_model_for_test(); 170 return RootGridView()->view_model_for_test();
171 } 171 }
172 172
173 const views::ViewModelT<AppListItemView>* FolderViewModel() { 173 const views::ViewModelT<AppListItemView>* FolderViewModel() {
174 return FolderGridView()->view_model_for_test(); 174 return FolderGridView()->view_model_for_test();
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 } 291 }
292 292
293 // Tests dragging an item out of a single item folder and dropping it onto the 293 // Tests dragging an item out of a single item folder and dropping it onto the
294 // page switcher. Regression test for http://crbug.com/415530/. 294 // page switcher. Regression test for http://crbug.com/415530/.
295 TEST_F(AppListMainViewTest, DragReparentItemOntoPageSwitcher) { 295 TEST_F(AppListMainViewTest, DragReparentItemOntoPageSwitcher) {
296 // Number of apps to populate. Should provide more than 1 page of apps (6*4 = 296 // Number of apps to populate. Should provide more than 1 page of apps (6*4 =
297 // 24). 297 // 24).
298 const int kNumApps = 30; 298 const int kNumApps = 30;
299 299
300 // Ensure we are on the apps grid view page. 300 // Ensure we are on the apps grid view page.
301 app_list::ContentsView* contents_view = ContentsView(); 301 app_list::ContentsView* contents_view_ptr = contents_view();
Matt Giuca 2014/12/02 06:13:18 I don't like the name "contents_view_ptr". It's un
302 contents_view->SetActivePage( 302 contents_view_ptr->SetActivePage(
303 contents_view->GetPageIndexForState(AppListModel::STATE_APPS)); 303 contents_view_ptr->GetPageIndexForState(AppListModel::STATE_APPS));
304 contents_view->Layout(); 304 contents_view_ptr->Layout();
305 305
306 AppListItemView* folder_item_view = CreateAndOpenSingleItemFolder(); 306 AppListItemView* folder_item_view = CreateAndOpenSingleItemFolder();
307 const gfx::Rect first_slot_tile = folder_item_view->bounds(); 307 const gfx::Rect first_slot_tile = folder_item_view->bounds();
308 308
309 delegate_->GetTestModel()->PopulateApps(kNumApps); 309 delegate_->GetTestModel()->PopulateApps(kNumApps);
310 310
311 EXPECT_EQ(1, FolderViewModel()->view_size()); 311 EXPECT_EQ(1, FolderViewModel()->view_size());
312 EXPECT_EQ(kNumApps + 1, RootViewModel()->view_size()); 312 EXPECT_EQ(kNumApps + 1, RootViewModel()->view_size());
313 313
314 AppListItemView* dragged = StartDragForReparent(0); 314 AppListItemView* dragged = StartDragForReparent(0);
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
377 // The app list model should remain unchanged. 377 // The app list model should remain unchanged.
378 EXPECT_EQ(1, FolderViewModel()->view_size()); 378 EXPECT_EQ(1, FolderViewModel()->view_size());
379 EXPECT_EQ(2, RootViewModel()->view_size()); 379 EXPECT_EQ(2, RootViewModel()->view_size());
380 EXPECT_EQ(folder_id, RootGridView()->GetItemViewAt(0)->item()->id()); 380 EXPECT_EQ(folder_id, RootGridView()->GetItemViewAt(0)->item()->id());
381 EXPECT_NE(nullptr, 381 EXPECT_NE(nullptr,
382 delegate_->GetTestModel()->FindFolderItem("single_item_folder")); 382 delegate_->GetTestModel()->FindFolderItem("single_item_folder"));
383 } 383 }
384 384
385 } // namespace test 385 } // namespace test
386 } // namespace app_list 386 } // namespace app_list
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698