OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/extensions/extension_install_prompt.h" | 6 #include "chrome/browser/extensions/extension_install_prompt.h" |
7 #include "chrome/browser/extensions/extension_service.h" | 7 #include "chrome/browser/extensions/extension_service.h" |
8 #include "chrome/browser/extensions/tab_helper.h" | 8 #include "chrome/browser/extensions/tab_helper.h" |
9 #include "chrome/browser/extensions/webstore_inline_installer.h" | 9 #include "chrome/browser/extensions/webstore_inline_installer.h" |
10 #include "chrome/browser/extensions/webstore_inline_installer_factory.h" | 10 #include "chrome/browser/extensions/webstore_inline_installer_factory.h" |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
160 ASSERT_FALSE(extension_service->IsExtensionEnabled(kTestExtensionId)); | 160 ASSERT_FALSE(extension_service->IsExtensionEnabled(kTestExtensionId)); |
161 | 161 |
162 // Revisit the inline install site and reinstall the extension. It should | 162 // Revisit the inline install site and reinstall the extension. It should |
163 // simply be re-enabled, rather than try to install again. | 163 // simply be re-enabled, rather than try to install again. |
164 ui_test_utils::NavigateToURL( | 164 ui_test_utils::NavigateToURL( |
165 browser(), GenerateTestServerUrl(kAppDomain, "install.html")); | 165 browser(), GenerateTestServerUrl(kAppDomain, "install.html")); |
166 RunTest("runTest"); | 166 RunTest("runTest"); |
167 ASSERT_TRUE(extension_service->IsExtensionEnabled(kTestExtensionId)); | 167 ASSERT_TRUE(extension_service->IsExtensionEnabled(kTestExtensionId)); |
168 } | 168 } |
169 | 169 |
170 class WebstoreInlineInstallerListenerTest : public WebstoreInlineInstallerTest { | |
171 public: | |
172 WebstoreInlineInstallerListenerTest() {} | |
173 virtual ~WebstoreInlineInstallerListenerTest() {} | |
174 | |
175 protected: | |
176 void RunTest(const std::string& file_name) { | |
177 CommandLine::ForCurrentProcess()->AppendSwitchASCII( | |
178 switches::kAppsGalleryInstallAutoConfirmForTests, "accept"); | |
not at google - send to devlin
2014/02/27 21:49:56
TODO(devlin): Add an ExtensionInstallPrompt::Scope
Devlin
2014/02/28 18:04:51
Done at the source (chrome/common/chrome_switches.
| |
179 ui_test_utils::NavigateToURL(browser(), | |
180 GenerateTestServerUrl(kAppDomain, file_name)); | |
181 WebstoreInstallerTest::RunTest("runTest"); | |
182 } | |
183 }; | |
184 | |
185 IN_PROC_BROWSER_TEST_F(WebstoreInlineInstallerListenerTest, | |
186 InstallStageListenerTest) { | |
187 RunTest("install_stage_listener.html"); | |
188 } | |
189 | |
190 IN_PROC_BROWSER_TEST_F(WebstoreInlineInstallerListenerTest, | |
191 DownloadProgressListenerTest) { | |
192 RunTest("download_progress_listener.html"); | |
193 } | |
194 | |
195 IN_PROC_BROWSER_TEST_F(WebstoreInlineInstallerListenerTest, | |
196 AddAndRemoveListenerTest) { | |
197 RunTest("add_and_remove_listener.html"); | |
Devlin
2014/02/28 18:04:51
These tests are now irrelevant (tested in the even
| |
198 } | |
199 | |
200 IN_PROC_BROWSER_TEST_F(WebstoreInlineInstallerListenerTest, | |
201 SetNullListenerTest) { | |
202 RunTest("set_null_listener.html"); | |
203 } | |
204 | |
205 IN_PROC_BROWSER_TEST_F(WebstoreInlineInstallerListenerTest, | |
206 SetInvalidListenerTest) { | |
207 RunTest("set_invalid_listener.html"); | |
208 } | |
209 | |
170 } // namespace extensions | 210 } // namespace extensions |
OLD | NEW |