| 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/extension_test_api.h" | 10 #include "chrome/browser/extensions/extension_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::OpenApplication( | 214 application_launch::OpenApplication( |
| 214 browser()->profile(), | 215 browser()->profile(), |
| 215 extension, | 216 extension, |
| 216 extension_misc::LAUNCH_NONE, | 217 extension_misc::LAUNCH_NONE, |
| 217 GURL(), | 218 GURL(), |
| 218 NEW_WINDOW); | 219 NEW_WINDOW, |
| 220 command_line); |
| 219 } | 221 } |
| 220 | 222 |
| 221 if (!catcher.GetNextResult()) { | 223 if (!catcher.GetNextResult()) { |
| 222 message_ = catcher.message(); | 224 message_ = catcher.message(); |
| 223 return false; | 225 return false; |
| 224 } else { | 226 } else { |
| 225 return true; | 227 return true; |
| 226 } | 228 } |
| 227 } | 229 } |
| 228 | 230 |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 292 ExtensionApiTest::SetUpCommandLine(command_line); | 294 ExtensionApiTest::SetUpCommandLine(command_line); |
| 293 | 295 |
| 294 // If someone is using this class, we're going to insist on management of the | 296 // If someone is using this class, we're going to insist on management of the |
| 295 // relevant flags. If these flags are already set, die. | 297 // relevant flags. If these flags are already set, die. |
| 296 DCHECK(!command_line->HasSwitch(switches::kEnablePlatformApps)); | 298 DCHECK(!command_line->HasSwitch(switches::kEnablePlatformApps)); |
| 297 DCHECK(!command_line->HasSwitch(switches::kEnableExperimentalExtensionApis)); | 299 DCHECK(!command_line->HasSwitch(switches::kEnableExperimentalExtensionApis)); |
| 298 | 300 |
| 299 command_line->AppendSwitch(switches::kEnableExperimentalExtensionApis); | 301 command_line->AppendSwitch(switches::kEnableExperimentalExtensionApis); |
| 300 command_line->AppendSwitch(switches::kEnablePlatformApps); | 302 command_line->AppendSwitch(switches::kEnablePlatformApps); |
| 301 } | 303 } |
| OLD | NEW |