Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(347)

Side by Side Diff: chrome/browser/extensions/webstore_inline_installer_browsertest.cc

Issue 175263003: Add chrome.webstore API methods to allow sites to see progress of installation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Latest master Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/extensions/tab_helper.cc ('k') | chrome/browser/extensions/webstore_installer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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");
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, BothListenersTest) {
196 RunTest("both_listeners.html");
197 }
198
170 } // namespace extensions 199 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/tab_helper.cc ('k') | chrome/browser/extensions/webstore_installer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698