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 "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 Loading... |
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 Loading... |
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 |
OLD | NEW |