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/download/download_crx_util.h" | 5 #include "chrome/browser/download/download_crx_util.h" |
6 #include "chrome/browser/download/download_service.h" | 6 #include "chrome/browser/download/download_service.h" |
7 #include "chrome/browser/download/download_service_factory.h" | 7 #include "chrome/browser/download/download_service_factory.h" |
8 #include "chrome/browser/download/download_test_observer.h" | 8 #include "chrome/browser/download/download_test_observer.h" |
9 #include "chrome/browser/extensions/crx_installer.h" | 9 #include "chrome/browser/extensions/crx_installer.h" |
10 #include "chrome/browser/extensions/extension_browsertest.h" | 10 #include "chrome/browser/extensions/extension_browsertest.h" |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 | 113 |
114 EXPECT_FALSE(InstallExtension(crx_path, 0)); | 114 EXPECT_FALSE(InstallExtension(crx_path, 0)); |
115 EXPECT_TRUE(InstallExtensionFromWebstore(crx_path, 1)); | 115 EXPECT_TRUE(InstallExtensionFromWebstore(crx_path, 1)); |
116 } | 116 } |
117 | 117 |
118 IN_PROC_BROWSER_TEST_F(ExtensionCrxInstallerTest, PlatformAppCrx) { | 118 IN_PROC_BROWSER_TEST_F(ExtensionCrxInstallerTest, PlatformAppCrx) { |
119 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 119 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
120 command_line->AppendSwitch(switches::kEnableExperimentalExtensionApis); | 120 command_line->AppendSwitch(switches::kEnableExperimentalExtensionApis); |
121 command_line->AppendSwitch(switches::kEnablePlatformApps); | 121 command_line->AppendSwitch(switches::kEnablePlatformApps); |
122 EXPECT_TRUE(InstallExtension( | 122 EXPECT_TRUE(InstallExtension( |
123 test_data_dir_.AppendASCII("generic_platform_app.crx"), 1)); | 123 test_data_dir_.AppendASCII("minimal_platform_app.crx"), 1)); |
124 } | 124 } |
125 | 125 |
126 IN_PROC_BROWSER_TEST_F(ExtensionCrxInstallerTest, PackAndInstallExtension) { | 126 IN_PROC_BROWSER_TEST_F(ExtensionCrxInstallerTest, PackAndInstallExtension) { |
127 const int kNumDownloadsExpected = 1; | 127 const int kNumDownloadsExpected = 1; |
128 const bool kExpectFileSelectDialog = false; | 128 const bool kExpectFileSelectDialog = false; |
129 | 129 |
130 LOG(ERROR) << "PackAndInstallExtension: Packing extension"; | 130 LOG(ERROR) << "PackAndInstallExtension: Packing extension"; |
131 FilePath crx_path = PackExtension( | 131 FilePath crx_path = PackExtension( |
132 test_data_dir_.AppendASCII("common/background_page")); | 132 test_data_dir_.AppendASCII("common/background_page")); |
133 ASSERT_FALSE(crx_path.empty()); | 133 ASSERT_FALSE(crx_path.empty()); |
(...skipping 15 matching lines...) Expand all Loading... |
149 DownloadTestObserver::ON_DANGEROUS_DOWNLOAD_ACCEPT)); | 149 DownloadTestObserver::ON_DANGEROUS_DOWNLOAD_ACCEPT)); |
150 LOG(ERROR) << "PackAndInstallExtension: Navigating to URL"; | 150 LOG(ERROR) << "PackAndInstallExtension: Navigating to URL"; |
151 ui_test_utils::NavigateToURLWithDisposition(browser(), url, CURRENT_TAB, | 151 ui_test_utils::NavigateToURLWithDisposition(browser(), url, CURRENT_TAB, |
152 ui_test_utils::BROWSER_TEST_NONE); | 152 ui_test_utils::BROWSER_TEST_NONE); |
153 | 153 |
154 EXPECT_TRUE(WaitForExtensionInstall()); | 154 EXPECT_TRUE(WaitForExtensionInstall()); |
155 LOG(ERROR) << "PackAndInstallExtension: Extension install"; | 155 LOG(ERROR) << "PackAndInstallExtension: Extension install"; |
156 EXPECT_TRUE(mock_ui->confirmation_requested()); | 156 EXPECT_TRUE(mock_ui->confirmation_requested()); |
157 LOG(ERROR) << "PackAndInstallExtension: Extension install confirmed"; | 157 LOG(ERROR) << "PackAndInstallExtension: Extension install confirmed"; |
158 } | 158 } |
OLD | NEW |