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 "chrome/browser/ui/app_list/app_list_service.h" | 5 #include "chrome/browser/ui/app_list/app_list_service.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/json/json_file_value_serializer.h" | 8 #include "base/json/json_file_value_serializer.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 | 138 |
139 controller->DismissView(); | 139 controller->DismissView(); |
140 ASSERT_FALSE(service->IsAppListVisible()); | 140 ASSERT_FALSE(service->IsAppListVisible()); |
141 } | 141 } |
142 | 142 |
143 // Interactive UI test that adds the --show-app-list command line switch. | 143 // Interactive UI test that adds the --show-app-list command line switch. |
144 class ShowAppListInteractiveTest : public InProcessBrowserTest { | 144 class ShowAppListInteractiveTest : public InProcessBrowserTest { |
145 public: | 145 public: |
146 ShowAppListInteractiveTest() {} | 146 ShowAppListInteractiveTest() {} |
147 | 147 |
148 void SetUpCommandLine(CommandLine* command_line) override { | 148 void SetUpCommandLine(base::CommandLine* command_line) override { |
149 command_line->AppendSwitch(switches::kShowAppList); | 149 command_line->AppendSwitch(switches::kShowAppList); |
150 } | 150 } |
151 | 151 |
152 private: | 152 private: |
153 DISALLOW_COPY_AND_ASSIGN(ShowAppListInteractiveTest); | 153 DISALLOW_COPY_AND_ASSIGN(ShowAppListInteractiveTest); |
154 }; | 154 }; |
155 | 155 |
156 // Test showing the app list using the command line switch. | 156 // Test showing the app list using the command line switch. |
157 #if defined(OS_CHROMEOS) | 157 #if defined(OS_CHROMEOS) |
158 // http://crbug.com/396499 | 158 // http://crbug.com/396499 |
(...skipping 12 matching lines...) Expand all Loading... |
171 // any browsers. | 171 // any browsers. |
172 Profile* profile = service->GetCurrentAppListProfile(); | 172 Profile* profile = service->GetCurrentAppListProfile(); |
173 CreateBrowser(profile); | 173 CreateBrowser(profile); |
174 | 174 |
175 service->DismissAppList(); | 175 service->DismissAppList(); |
176 EXPECT_FALSE(service->IsAppListVisible()); | 176 EXPECT_FALSE(service->IsAppListVisible()); |
177 | 177 |
178 // With Chrome still running, test receiving a second --show-app-list request | 178 // With Chrome still running, test receiving a second --show-app-list request |
179 // via the process singleton. ChromeOS has no process singleton so exclude it. | 179 // via the process singleton. ChromeOS has no process singleton so exclude it. |
180 #if !defined(OS_CHROMEOS) | 180 #if !defined(OS_CHROMEOS) |
181 CommandLine command_line(CommandLine::NO_PROGRAM); | 181 base::CommandLine command_line(base::CommandLine::NO_PROGRAM); |
182 command_line.AppendSwitch(switches::kShowAppList); | 182 command_line.AppendSwitch(switches::kShowAppList); |
183 StartupBrowserCreator::ProcessCommandLineAlreadyRunning( | 183 StartupBrowserCreator::ProcessCommandLineAlreadyRunning( |
184 command_line, base::FilePath(), profile->GetPath()); | 184 command_line, base::FilePath(), profile->GetPath()); |
185 | 185 |
186 EXPECT_TRUE(service->IsAppListVisible()); | 186 EXPECT_TRUE(service->IsAppListVisible()); |
187 service->DismissAppList(); | 187 service->DismissAppList(); |
188 EXPECT_FALSE(service->IsAppListVisible()); | 188 EXPECT_FALSE(service->IsAppListVisible()); |
189 #endif | 189 #endif |
190 } | 190 } |
191 | 191 |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 CreateBrowser(profile_manager->GetLastUsedProfile()); | 261 CreateBrowser(profile_manager->GetLastUsedProfile()); |
262 | 262 |
263 // Delete the profile being used by the app list. | 263 // Delete the profile being used by the app list. |
264 profile_manager->ScheduleProfileForDeletion( | 264 profile_manager->ScheduleProfileForDeletion( |
265 service->GetCurrentAppListProfile()->GetPath(), | 265 service->GetCurrentAppListProfile()->GetPath(), |
266 ProfileManager::CreateCallback()); | 266 ProfileManager::CreateCallback()); |
267 | 267 |
268 // App Launcher should get closed immediately and nothing should explode. | 268 // App Launcher should get closed immediately and nothing should explode. |
269 EXPECT_FALSE(service->IsAppListVisible()); | 269 EXPECT_FALSE(service->IsAppListVisible()); |
270 } | 270 } |
OLD | NEW |