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 "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/files/scoped_temp_dir.h" | 6 #include "base/files/scoped_temp_dir.h" |
7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
10 #include "chrome/browser/profiles/profile_manager.h" | 10 #include "chrome/browser/profiles/profile_manager.h" |
11 #include "chrome/browser/ui/app_list/app_list_service.h" | 11 #include "chrome/browser/ui/app_list/app_list_service.h" |
12 #include "chrome/browser/ui/browser.h" | 12 #include "chrome/browser/ui/browser.h" |
13 #include "chrome/common/chrome_switches.h" | 13 #include "chrome/common/chrome_switches.h" |
14 #include "chrome/common/pref_names.h" | 14 #include "chrome/common/pref_names.h" |
15 #include "chrome/test/base/in_process_browser_test.h" | 15 #include "chrome/test/base/in_process_browser_test.h" |
16 #include "chrome/test/base/ui_test_utils.h" | 16 #include "chrome/test/base/ui_test_utils.h" |
17 | 17 |
18 // Browser Test for AppListController that runs on all platforms supporting | 18 // Browser Test for AppListController that runs on all platforms supporting |
19 // app_list. | 19 // app_list. |
20 class AppListControllerBrowserTest : public InProcessBrowserTest { | 20 class AppListControllerBrowserTest : public InProcessBrowserTest { |
21 public: | 21 public: |
22 AppListControllerBrowserTest() | 22 AppListControllerBrowserTest() |
23 : profile2_(NULL) {} | 23 : profile2_(NULL) {} |
24 | 24 |
25 void OnProfileCreated(Profile* profile, Profile::CreateStatus status) { | 25 void OnProfileCreated(Profile* profile, Profile::CreateStatus status) { |
26 if (status == Profile::CREATE_STATUS_INITIALIZED) { | 26 if (status == Profile::CREATE_STATUS_INITIALIZED) { |
27 profile2_ = profile; | 27 profile2_ = profile; |
28 MessageLoop::current()->Quit(); | 28 base::MessageLoop::current()->Quit(); |
29 } | 29 } |
30 } | 30 } |
31 | 31 |
32 protected: | 32 protected: |
33 base::ScopedTempDir temp_profile_dir_; | 33 base::ScopedTempDir temp_profile_dir_; |
34 Profile* profile2_; | 34 Profile* profile2_; |
35 | 35 |
36 private: | 36 private: |
37 DISALLOW_COPY_AND_ASSIGN(AppListControllerBrowserTest); | 37 DISALLOW_COPY_AND_ASSIGN(AppListControllerBrowserTest); |
38 }; | 38 }; |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 ASSERT_TRUE(service->IsAppListVisible()); | 92 ASSERT_TRUE(service->IsAppListVisible()); |
93 | 93 |
94 // Create a browser to prevent shutdown when we dismiss the app list. We | 94 // Create a browser to prevent shutdown when we dismiss the app list. We |
95 // need to do this because switches::kShowAppList suppresses the creation of | 95 // need to do this because switches::kShowAppList suppresses the creation of |
96 // any browsers. | 96 // any browsers. |
97 CreateBrowser(service->GetCurrentAppListProfile()); | 97 CreateBrowser(service->GetCurrentAppListProfile()); |
98 service->DismissAppList(); | 98 service->DismissAppList(); |
99 } | 99 } |
100 #endif // !defined(OS_MACOSX) | 100 #endif // !defined(OS_MACOSX) |
101 #endif // !defined(OS_CHROMEOS) && !defined(USE_AURA) | 101 #endif // !defined(OS_CHROMEOS) && !defined(USE_AURA) |
OLD | NEW |