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

Unified Diff: chrome/browser/extensions/webstore_inline_installer_browsertest.cc

Issue 2103663002: [Extensions] Rework inline installation observation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: missingfile Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/extensions/tab_helper.cc ('k') | chrome/browser/extensions/webstore_standalone_installer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/webstore_inline_installer_browsertest.cc
diff --git a/chrome/browser/extensions/webstore_inline_installer_browsertest.cc b/chrome/browser/extensions/webstore_inline_installer_browsertest.cc
index d6c561dc0e1c8373c2ff087088ca128ec4082b7f..a2a25b7bda28e4da75a5667a87f3a95a2aa800b8 100644
--- a/chrome/browser/extensions/webstore_inline_installer_browsertest.cc
+++ b/chrome/browser/extensions/webstore_inline_installer_browsertest.cc
@@ -309,6 +309,14 @@ IN_PROC_BROWSER_TEST_F(WebstoreInlineInstallerTest,
ExtensionInstallPrompt::g_last_prompt_type_for_tests);
}
+// Test calling chrome.webstore.install() twice without waiting for the first to
+// finish.
+IN_PROC_BROWSER_TEST_F(WebstoreInlineInstallerTest, DoubleInlineInstallTest) {
+ ui_test_utils::NavigateToURL(
+ browser(), GenerateTestServerUrl(kAppDomain, "double_install.html"));
+ RunTest("runTest");
+}
+
class WebstoreInlineInstallerListenerTest : public WebstoreInlineInstallerTest {
public:
WebstoreInlineInstallerListenerTest() {}
@@ -335,6 +343,26 @@ IN_PROC_BROWSER_TEST_F(WebstoreInlineInstallerListenerTest,
IN_PROC_BROWSER_TEST_F(WebstoreInlineInstallerListenerTest, BothListenersTest) {
RunTest("both_listeners.html");
+ // The extension should be installed.
+ ExtensionRegistry* registry = ExtensionRegistry::Get(profile());
+ EXPECT_TRUE(registry->enabled_extensions().GetByID(kTestExtensionId));
+
+ // Rinse and repeat: uninstall the extension, open a new tab, and install it
+ // again. Regression test for crbug.com/613949.
+ extension_service()->UninstallExtension(
+ kTestExtensionId, UNINSTALL_REASON_FOR_TESTING,
+ base::Bind(&base::DoNothing), nullptr);
+ base::RunLoop().RunUntilIdle();
+ EXPECT_FALSE(registry->enabled_extensions().GetByID(kTestExtensionId));
+ int old_tab_index = browser()->tab_strip_model()->active_index();
+ ui_test_utils::NavigateToURLWithDisposition(
+ browser(), GenerateTestServerUrl(kAppDomain, "both_listeners.html"),
+ NEW_FOREGROUND_TAB, ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION);
+ DCHECK_NE(old_tab_index, browser()->tab_strip_model()->active_index());
+ browser()->tab_strip_model()->CloseWebContentsAt(old_tab_index,
+ TabStripModel::CLOSE_NONE);
+ WebstoreInstallerTest::RunTest("runTest");
+ EXPECT_TRUE(registry->enabled_extensions().GetByID(kTestExtensionId));
}
} // namespace extensions
« no previous file with comments | « chrome/browser/extensions/tab_helper.cc ('k') | chrome/browser/extensions/webstore_standalone_installer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698