OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/extensions/extension_apitest.h" | 5 #include "chrome/browser/extensions/extension_apitest.h" |
6 | 6 |
7 #include "base/string_util.h" | 7 #include "base/string_util.h" |
8 #include "base/stringprintf.h" | 8 #include "base/stringprintf.h" |
9 #include "chrome/browser/extensions/extension_service.h" | 9 #include "chrome/browser/extensions/extension_service.h" |
10 #include "chrome/browser/extensions/api/test/test_api.h" | 10 #include "chrome/browser/extensions/api/test/test_api.h" |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 | 203 |
204 url = extension->GetResourceURL(page_url); | 204 url = extension->GetResourceURL(page_url); |
205 } | 205 } |
206 | 206 |
207 if (use_incognito) | 207 if (use_incognito) |
208 ui_test_utils::OpenURLOffTheRecord(browser()->profile(), url); | 208 ui_test_utils::OpenURLOffTheRecord(browser()->profile(), url); |
209 else | 209 else |
210 ui_test_utils::NavigateToURL(browser(), url); | 210 ui_test_utils::NavigateToURL(browser(), url); |
211 | 211 |
212 } else if (launch_platform_app) { | 212 } else if (launch_platform_app) { |
213 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 213 application_launch::LaunchParams params(browser()->profile(), extension, |
214 application_launch::OpenApplication( | 214 extension_misc::LAUNCH_NONE, |
215 browser()->profile(), | 215 NEW_WINDOW); |
216 extension, | 216 params.command_line = CommandLine::ForCurrentProcess(); |
217 extension_misc::LAUNCH_NONE, | 217 application_launch::OpenApplication(params); |
218 GURL(), | |
219 NEW_WINDOW, | |
220 command_line); | |
221 } | 218 } |
222 | 219 |
223 if (!catcher.GetNextResult()) { | 220 if (!catcher.GetNextResult()) { |
224 message_ = catcher.message(); | 221 message_ = catcher.message(); |
225 return false; | 222 return false; |
226 } else { | 223 } else { |
227 return true; | 224 return true; |
228 } | 225 } |
229 } | 226 } |
230 | 227 |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 | 289 |
293 void PlatformAppApiTest::SetUpCommandLine(CommandLine* command_line) { | 290 void PlatformAppApiTest::SetUpCommandLine(CommandLine* command_line) { |
294 ExtensionApiTest::SetUpCommandLine(command_line); | 291 ExtensionApiTest::SetUpCommandLine(command_line); |
295 | 292 |
296 // If someone is using this class, we're going to insist on management of the | 293 // If someone is using this class, we're going to insist on management of the |
297 // relevant flags. If these flags are already set, die. | 294 // relevant flags. If these flags are already set, die. |
298 DCHECK(!command_line->HasSwitch(switches::kEnableExperimentalExtensionApis)); | 295 DCHECK(!command_line->HasSwitch(switches::kEnableExperimentalExtensionApis)); |
299 | 296 |
300 command_line->AppendSwitch(switches::kEnableExperimentalExtensionApis); | 297 command_line->AppendSwitch(switches::kEnableExperimentalExtensionApis); |
301 } | 298 } |
OLD | NEW |