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

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

Issue 1355063004: Template methods on Timer classes instead of the classes themselves. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: timer: fixcaller Created 5 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
« no previous file with comments | « ui/app_list/views/app_list_main_view.h ('k') | ui/app_list/views/apps_grid_view.h » ('j') | 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 } 52 }
53 53
54 private: 54 private:
55 void OnTimerCheck() { 55 void OnTimerCheck() {
56 if (grid_view_->visible()) 56 if (grid_view_->visible())
57 run_loop_->Quit(); 57 run_loop_->Quit();
58 } 58 }
59 59
60 AppsGridView* grid_view_; 60 AppsGridView* grid_view_;
61 scoped_ptr<base::RunLoop> run_loop_; 61 scoped_ptr<base::RunLoop> run_loop_;
62 base::RepeatingTimer<GridViewVisibleWaiter> check_timer_; 62 base::RepeatingTimer check_timer_;
63 63
64 DISALLOW_COPY_AND_ASSIGN(GridViewVisibleWaiter); 64 DISALLOW_COPY_AND_ASSIGN(GridViewVisibleWaiter);
65 }; 65 };
66 66
67 class AppListMainViewTest : public views::ViewsTestBase { 67 class AppListMainViewTest : public views::ViewsTestBase {
68 public: 68 public:
69 AppListMainViewTest() 69 AppListMainViewTest()
70 : main_widget_(nullptr), 70 : main_widget_(nullptr),
71 main_view_(nullptr), 71 main_view_(nullptr),
72 search_box_widget_(nullptr), 72 search_box_widget_(nullptr),
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after
454 // The app list model should remain unchanged. 454 // The app list model should remain unchanged.
455 EXPECT_EQ(1, FolderViewModel()->view_size()); 455 EXPECT_EQ(1, FolderViewModel()->view_size());
456 EXPECT_EQ(2, RootViewModel()->view_size()); 456 EXPECT_EQ(2, RootViewModel()->view_size());
457 EXPECT_EQ(folder_id, RootGridView()->GetItemViewAt(0)->item()->id()); 457 EXPECT_EQ(folder_id, RootGridView()->GetItemViewAt(0)->item()->id());
458 EXPECT_NE(nullptr, 458 EXPECT_NE(nullptr,
459 delegate_->GetTestModel()->FindFolderItem("single_item_folder")); 459 delegate_->GetTestModel()->FindFolderItem("single_item_folder"));
460 } 460 }
461 461
462 } // namespace test 462 } // namespace test
463 } // namespace app_list 463 } // namespace app_list
OLDNEW
« no previous file with comments | « ui/app_list/views/app_list_main_view.h ('k') | ui/app_list/views/apps_grid_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698