| 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" |
| 11 #include "chrome/browser/extensions/unpacked_installer.h" | 11 #include "chrome/browser/extensions/unpacked_installer.h" |
| 12 #include "chrome/browser/profiles/profile.h" | 12 #include "chrome/browser/profiles/profile.h" |
| 13 #include "chrome/browser/profiles/profile.h" | 13 #include "chrome/browser/profiles/profile.h" |
| 14 #include "chrome/browser/ui/browser.h" | 14 #include "chrome/browser/ui/browser.h" |
| 15 #include "chrome/browser/ui/extensions/application_launch.h" |
| 15 #include "chrome/common/chrome_notification_types.h" | 16 #include "chrome/common/chrome_notification_types.h" |
| 16 #include "chrome/common/chrome_switches.h" | 17 #include "chrome/common/chrome_switches.h" |
| 17 #include "chrome/test/base/ui_test_utils.h" | 18 #include "chrome/test/base/ui_test_utils.h" |
| 18 #include "content/public/browser/notification_registrar.h" | 19 #include "content/public/browser/notification_registrar.h" |
| 19 #include "content/public/browser/notification_service.h" | 20 #include "content/public/browser/notification_service.h" |
| 20 #include "net/base/net_util.h" | 21 #include "net/base/net_util.h" |
| 21 | 22 |
| 22 namespace { | 23 namespace { |
| 23 | 24 |
| 24 const char kTestServerPort[] = "testServer.port"; | 25 const char kTestServerPort[] = "testServer.port"; |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 | 203 |
| 203 url = extension->GetResourceURL(page_url); | 204 url = extension->GetResourceURL(page_url); |
| 204 } | 205 } |
| 205 | 206 |
| 206 if (use_incognito) | 207 if (use_incognito) |
| 207 ui_test_utils::OpenURLOffTheRecord(browser()->profile(), url); | 208 ui_test_utils::OpenURLOffTheRecord(browser()->profile(), url); |
| 208 else | 209 else |
| 209 ui_test_utils::NavigateToURL(browser(), url); | 210 ui_test_utils::NavigateToURL(browser(), url); |
| 210 | 211 |
| 211 } else if (launch_platform_app) { | 212 } else if (launch_platform_app) { |
| 212 Browser::OpenApplication( | 213 application_launch::OpenApplication( |
| 213 browser()->profile(), | 214 browser()->profile(), |
| 214 extension, | 215 extension, |
| 215 extension_misc::LAUNCH_NONE, | 216 extension_misc::LAUNCH_NONE, |
| 216 GURL(), | 217 GURL(), |
| 217 NEW_WINDOW); | 218 NEW_WINDOW); |
| 218 } | 219 } |
| 219 | 220 |
| 220 if (!catcher.GetNextResult()) { | 221 if (!catcher.GetNextResult()) { |
| 221 message_ = catcher.message(); | 222 message_ = catcher.message(); |
| 222 return false; | 223 return false; |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 ExtensionApiTest::SetUpCommandLine(command_line); | 292 ExtensionApiTest::SetUpCommandLine(command_line); |
| 292 | 293 |
| 293 // If someone is using this class, we're going to insist on management of the | 294 // If someone is using this class, we're going to insist on management of the |
| 294 // relevant flags. If these flags are already set, die. | 295 // relevant flags. If these flags are already set, die. |
| 295 DCHECK(!command_line->HasSwitch(switches::kEnablePlatformApps)); | 296 DCHECK(!command_line->HasSwitch(switches::kEnablePlatformApps)); |
| 296 DCHECK(!command_line->HasSwitch(switches::kEnableExperimentalExtensionApis)); | 297 DCHECK(!command_line->HasSwitch(switches::kEnableExperimentalExtensionApis)); |
| 297 | 298 |
| 298 command_line->AppendSwitch(switches::kEnableExperimentalExtensionApis); | 299 command_line->AppendSwitch(switches::kEnableExperimentalExtensionApis); |
| 299 command_line->AppendSwitch(switches::kEnablePlatformApps); | 300 command_line->AppendSwitch(switches::kEnablePlatformApps); |
| 300 } | 301 } |
| OLD | NEW |