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

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: woo 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
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..b00579d5349979a6d4c86282a41f1414bef0c2cc 100644
--- a/chrome/browser/extensions/webstore_inline_installer_browsertest.cc
+++ b/chrome/browser/extensions/webstore_inline_installer_browsertest.cc
@@ -335,6 +335,30 @@ 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

Powered by Google App Engine
This is Rietveld 408576698