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 "chrome/browser/chrome_notification_types.h" | 6 #include "chrome/browser/chrome_notification_types.h" |
7 #include "chrome/browser/extensions/extension_host.h" | 7 #include "chrome/browser/extensions/extension_host.h" |
8 #include "chrome/browser/extensions/extension_install_ui.h" | 8 #include "chrome/browser/extensions/extension_install_ui.h" |
9 #include "chrome/browser/extensions/extension_service.h" | 9 #include "chrome/browser/extensions/extension_service.h" |
10 #include "chrome/browser/extensions/startup_helper.h" | 10 #include "chrome/browser/extensions/startup_helper.h" |
11 #include "chrome/browser/extensions/webstore_installer_test.h" | 11 #include "chrome/browser/extensions/webstore_installer_test.h" |
| 12 #include "chrome/browser/infobars/infobar_manager.h" |
12 #include "chrome/browser/infobars/infobar_service.h" | 13 #include "chrome/browser/infobars/infobar_service.h" |
13 #include "chrome/browser/managed_mode/managed_user_service.h" | 14 #include "chrome/browser/managed_mode/managed_user_service.h" |
14 #include "chrome/browser/managed_mode/managed_user_service_factory.h" | 15 #include "chrome/browser/managed_mode/managed_user_service_factory.h" |
15 #include "chrome/browser/profiles/profile.h" | 16 #include "chrome/browser/profiles/profile.h" |
16 #include "chrome/browser/ui/browser.h" | 17 #include "chrome/browser/ui/browser.h" |
17 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 18 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
18 #include "chrome/common/chrome_switches.h" | 19 #include "chrome/common/chrome_switches.h" |
19 #include "chrome/common/pref_names.h" | 20 #include "chrome/common/pref_names.h" |
20 #include "chrome/test/base/in_process_browser_test.h" | 21 #include "chrome/test/base/in_process_browser_test.h" |
21 #include "chrome/test/base/test_switches.h" | 22 #include "chrome/test/base/test_switches.h" |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 switches::kAppsGalleryInstallAutoConfirmForTests, "accept"); | 194 switches::kAppsGalleryInstallAutoConfirmForTests, "accept"); |
194 | 195 |
195 ui_test_utils::NavigateToURL( | 196 ui_test_utils::NavigateToURL( |
196 browser(), GenerateTestServerUrl(kAppDomain, "install_prohibited.html")); | 197 browser(), GenerateTestServerUrl(kAppDomain, "install_prohibited.html")); |
197 | 198 |
198 RunTest("runTest"); | 199 RunTest("runTest"); |
199 | 200 |
200 // No error infobar should show up. | 201 // No error infobar should show up. |
201 WebContents* contents = browser()->tab_strip_model()->GetActiveWebContents(); | 202 WebContents* contents = browser()->tab_strip_model()->GetActiveWebContents(); |
202 InfoBarService* info_bar_service = InfoBarService::FromWebContents(contents); | 203 InfoBarService* info_bar_service = InfoBarService::FromWebContents(contents); |
203 EXPECT_EQ(info_bar_service->infobar_count(), 0u); | 204 EXPECT_EQ(info_bar_service->infobar_manager().infobar_count(), 0u); |
204 } | 205 } |
205 | 206 |
206 // The unpack failure test needs to use a different install .crx, which is | 207 // The unpack failure test needs to use a different install .crx, which is |
207 // specified via a command-line flag, so it needs its own test subclass. | 208 // specified via a command-line flag, so it needs its own test subclass. |
208 class WebstoreStartupInstallUnpackFailureTest | 209 class WebstoreStartupInstallUnpackFailureTest |
209 : public WebstoreStartupInstallerTest { | 210 : public WebstoreStartupInstallerTest { |
210 public: | 211 public: |
211 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 212 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
212 WebstoreStartupInstallerTest::SetUpCommandLine(command_line); | 213 WebstoreStartupInstallerTest::SetUpCommandLine(command_line); |
213 | 214 |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
324 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 325 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
325 command_line->AppendSwitchASCII( | 326 command_line->AppendSwitchASCII( |
326 switches::kLimitedInstallFromWebstore, "2"); | 327 switches::kLimitedInstallFromWebstore, "2"); |
327 helper.LimitedInstallFromWebstore(*command_line, browser()->profile(), | 328 helper.LimitedInstallFromWebstore(*command_line, browser()->profile(), |
328 base::MessageLoop::QuitWhenIdleClosure()); | 329 base::MessageLoop::QuitWhenIdleClosure()); |
329 base::MessageLoop::current()->Run(); | 330 base::MessageLoop::current()->Run(); |
330 | 331 |
331 EXPECT_TRUE(saw_install()); | 332 EXPECT_TRUE(saw_install()); |
332 EXPECT_EQ(0, browser_open_count()); | 333 EXPECT_EQ(0, browser_open_count()); |
333 } | 334 } |
OLD | NEW |