| 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 "base/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "base/stringprintf.h" | 6 #include "base/stringprintf.h" |
| 7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
| 8 #include "chrome/browser/extensions/extension_host.h" | 8 #include "chrome/browser/extensions/extension_host.h" |
| 9 #include "chrome/browser/extensions/extension_install_ui.h" | 9 #include "chrome/browser/extensions/extension_install_ui.h" |
| 10 #include "chrome/browser/extensions/extension_service.h" | 10 #include "chrome/browser/extensions/extension_service.h" |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 public: | 196 public: |
| 197 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 197 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
| 198 WebstoreStandaloneInstallTest::SetUpCommandLine(command_line); | 198 WebstoreStandaloneInstallTest::SetUpCommandLine(command_line); |
| 199 | 199 |
| 200 GURL crx_url = GenerateTestServerUrl( | 200 GURL crx_url = GenerateTestServerUrl( |
| 201 kWebstoreDomain, "malformed_extension.crx"); | 201 kWebstoreDomain, "malformed_extension.crx"); |
| 202 CommandLine::ForCurrentProcess()->AppendSwitchASCII( | 202 CommandLine::ForCurrentProcess()->AppendSwitchASCII( |
| 203 switches::kAppsGalleryUpdateURL, crx_url.spec()); | 203 switches::kAppsGalleryUpdateURL, crx_url.spec()); |
| 204 } | 204 } |
| 205 | 205 |
| 206 void SetUpInProcessBrowserTestFixture() OVERRIDE { | 206 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { |
| 207 WebstoreStandaloneInstallTest::SetUpInProcessBrowserTestFixture(); | 207 WebstoreStandaloneInstallTest::SetUpInProcessBrowserTestFixture(); |
| 208 ExtensionInstallUI::DisableFailureUIForTests(); | 208 ExtensionInstallUI::DisableFailureUIForTests(); |
| 209 } | 209 } |
| 210 }; | 210 }; |
| 211 | 211 |
| 212 IN_PROC_BROWSER_TEST_F(WebstoreStandaloneInstallUnpackFailureTest, | 212 IN_PROC_BROWSER_TEST_F(WebstoreStandaloneInstallUnpackFailureTest, |
| 213 WebstoreStandaloneInstallUnpackFailureTest) { | 213 WebstoreStandaloneInstallUnpackFailureTest) { |
| 214 CommandLine::ForCurrentProcess()->AppendSwitchASCII( | 214 CommandLine::ForCurrentProcess()->AppendSwitchASCII( |
| 215 switches::kAppsGalleryInstallAutoConfirmForTests, "accept"); | 215 switches::kAppsGalleryInstallAutoConfirmForTests, "accept"); |
| 216 | 216 |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 | 277 |
| 278 IN_PROC_BROWSER_TEST_F(CommandLineWebstoreInstall, Cancel) { | 278 IN_PROC_BROWSER_TEST_F(CommandLineWebstoreInstall, Cancel) { |
| 279 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 279 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
| 280 command_line->AppendSwitchASCII( | 280 command_line->AppendSwitchASCII( |
| 281 switches::kAppsGalleryInstallAutoConfirmForTests, "cancel"); | 281 switches::kAppsGalleryInstallAutoConfirmForTests, "cancel"); |
| 282 extensions::StartupHelper helper; | 282 extensions::StartupHelper helper; |
| 283 EXPECT_FALSE(helper.InstallFromWebstore(*command_line, browser()->profile())); | 283 EXPECT_FALSE(helper.InstallFromWebstore(*command_line, browser()->profile())); |
| 284 EXPECT_FALSE(saw_install()); | 284 EXPECT_FALSE(saw_install()); |
| 285 EXPECT_EQ(0, browser_open_count()); | 285 EXPECT_EQ(0, browser_open_count()); |
| 286 } | 286 } |
| OLD | NEW |