OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_view.h" | 5 #include "ui/app_list/views/app_list_view.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 15 matching lines...) Expand all Loading... |
26 #include "ui/app_list/test/test_search_result.h" | 26 #include "ui/app_list/test/test_search_result.h" |
27 #include "ui/app_list/views/app_list_folder_view.h" | 27 #include "ui/app_list/views/app_list_folder_view.h" |
28 #include "ui/app_list/views/app_list_main_view.h" | 28 #include "ui/app_list/views/app_list_main_view.h" |
29 #include "ui/app_list/views/apps_container_view.h" | 29 #include "ui/app_list/views/apps_container_view.h" |
30 #include "ui/app_list/views/apps_grid_view.h" | 30 #include "ui/app_list/views/apps_grid_view.h" |
31 #include "ui/app_list/views/contents_view.h" | 31 #include "ui/app_list/views/contents_view.h" |
32 #include "ui/app_list/views/search_box_view.h" | 32 #include "ui/app_list/views/search_box_view.h" |
33 #include "ui/app_list/views/search_result_page_view.h" | 33 #include "ui/app_list/views/search_result_page_view.h" |
34 #include "ui/app_list/views/search_result_tile_item_view.h" | 34 #include "ui/app_list/views/search_result_tile_item_view.h" |
35 #include "ui/app_list/views/start_page_view.h" | 35 #include "ui/app_list/views/start_page_view.h" |
| 36 #include "ui/app_list/views/test/app_list_view_test_api.h" |
36 #include "ui/app_list/views/test/apps_grid_view_test_api.h" | 37 #include "ui/app_list/views/test/apps_grid_view_test_api.h" |
37 #include "ui/app_list/views/tile_item_view.h" | 38 #include "ui/app_list/views/tile_item_view.h" |
38 #include "ui/events/event_utils.h" | 39 #include "ui/events/event_utils.h" |
39 #include "ui/views/controls/textfield/textfield.h" | 40 #include "ui/views/controls/textfield/textfield.h" |
40 #include "ui/views/test/test_views_delegate.h" | 41 #include "ui/views/test/test_views_delegate.h" |
41 #include "ui/views/test/views_test_base.h" | 42 #include "ui/views/test/views_test_base.h" |
42 #include "ui/views/views_delegate.h" | 43 #include "ui/views/views_delegate.h" |
43 #include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h" | 44 #include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h" |
44 | 45 |
45 namespace app_list { | 46 namespace app_list { |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 success = success && | 253 success = success && |
253 (contents_view->GetPageView(i)->GetPageBoundsForState(state) == | 254 (contents_view->GetPageView(i)->GetPageBoundsForState(state) == |
254 contents_view->GetPageView(i)->bounds()); | 255 contents_view->GetPageView(i)->bounds()); |
255 } | 256 } |
256 return success && state == delegate_->GetTestModel()->state(); | 257 return success && state == delegate_->GetTestModel()->state(); |
257 } | 258 } |
258 | 259 |
259 void AppListViewTestContext::Show() { | 260 void AppListViewTestContext::Show() { |
260 view_->GetWidget()->Show(); | 261 view_->GetWidget()->Show(); |
261 run_loop_.reset(new base::RunLoop); | 262 run_loop_.reset(new base::RunLoop); |
262 view_->SetNextPaintCallback(run_loop_->QuitClosure()); | 263 AppListViewTestApi test_api(view_); |
| 264 test_api.SetNextPaintCallback(run_loop_->QuitClosure()); |
263 run_loop_->Run(); | 265 run_loop_->Run(); |
264 | 266 |
265 EXPECT_TRUE(view_->GetWidget()->IsVisible()); | 267 EXPECT_TRUE(view_->GetWidget()->IsVisible()); |
266 } | 268 } |
267 | 269 |
268 void AppListViewTestContext::Close() { | 270 void AppListViewTestContext::Close() { |
269 view_->GetWidget()->Close(); | 271 view_->GetWidget()->Close(); |
270 run_loop_.reset(new base::RunLoop); | 272 run_loop_.reset(new base::RunLoop); |
271 run_loop_->Run(); | 273 run_loop_->Run(); |
272 | 274 |
(...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
855 AppListViewTestAura, | 857 AppListViewTestAura, |
856 ::testing::Range<int>(TEST_TYPE_START, TEST_TYPE_END)); | 858 ::testing::Range<int>(TEST_TYPE_START, TEST_TYPE_END)); |
857 #endif | 859 #endif |
858 | 860 |
859 INSTANTIATE_TEST_CASE_P(AppListViewTestDesktopInstance, | 861 INSTANTIATE_TEST_CASE_P(AppListViewTestDesktopInstance, |
860 AppListViewTestDesktop, | 862 AppListViewTestDesktop, |
861 ::testing::Range<int>(TEST_TYPE_START, TEST_TYPE_END)); | 863 ::testing::Range<int>(TEST_TYPE_START, TEST_TYPE_END)); |
862 | 864 |
863 } // namespace test | 865 } // namespace test |
864 } // namespace app_list | 866 } // namespace app_list |
OLD | NEW |