Commit b6128ffa authored by Bettina's avatar Bettina Committed by Commit Bot

Open the uninstall url after extension uninstall on CWS.

We created another uninstall reason when uninstall functionality
was made available in Chrome Web Store but didn't update the
condition for showing the uninstall URL.

I've re-enabled the browser test for
EnsureExtensionUninstallURLIsActiveTabAfterUninstall since I've
run the test 100 times in one run and 600 times in another run and
it did not fail.

Bug: 900554
Change-Id: I805840717709606a8e98d1c82cbea2b611efdfd6
Reviewed-on: https://chromium-review.googlesource.com/c/1336522
Commit-Queue: Bettina Dea <bdea@chromium.org>
Reviewed-by: default avatarDevlin <rdevlin.cronin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#608937}
parent 3f565126
...@@ -174,14 +174,15 @@ IN_PROC_BROWSER_TEST_F(ExtensionUninstallDialogViewBrowserTest, ...@@ -174,14 +174,15 @@ IN_PROC_BROWSER_TEST_F(ExtensionUninstallDialogViewBrowserTest,
} }
#endif // defined(OS_CHROMEOS) #endif // defined(OS_CHROMEOS)
// Test that when the user clicks Uninstall on the ExtensionUninstallDialog, the class ParameterizedExtensionUninstallDialogViewBrowserTest
: public InProcessBrowserTest,
public testing::WithParamInterface<extensions::UninstallReason> {};
// Test that when the user clicks Uninstall on the ExtensionUninstallDialog the
// extension's uninstall url (when it is specified) should open and be the // extension's uninstall url (when it is specified) should open and be the
// active tab. // active tab.
// TODO(catmullings): Disabled due to flake on Win 10 x64. IN_PROC_BROWSER_TEST_P(ParameterizedExtensionUninstallDialogViewBrowserTest,
// https://crbug.com/725197 EnsureExtensionUninstallURLIsActiveTabAfterUninstall) {
IN_PROC_BROWSER_TEST_F(
ExtensionUninstallDialogViewBrowserTest,
DISABLED_EnsureExtensionUninstallURLIsActiveTabAfterUninstall) {
scoped_refptr<const extensions::Extension> extension(BuildTestExtension()); scoped_refptr<const extensions::Extension> extension(BuildTestExtension());
extensions::ExtensionService* extension_service = extensions::ExtensionService* extension_service =
extensions::ExtensionSystem::Get(browser()->profile()) extensions::ExtensionSystem::Get(browser()->profile())
...@@ -203,10 +204,8 @@ IN_PROC_BROWSER_TEST_F( ...@@ -203,10 +204,8 @@ IN_PROC_BROWSER_TEST_F(
&delegate)); &delegate));
content::RunAllPendingInMessageLoop(); content::RunAllPendingInMessageLoop();
dialog->ConfirmUninstall(extension, extensions::UninstallReason uninstall_reason = GetParam();
// UNINSTALL_REASON_USER_INITIATED is used to trigger dialog->ConfirmUninstall(extension, uninstall_reason,
// complete uninstallation.
extensions::UNINSTALL_REASON_USER_INITIATED,
extensions::UNINSTALL_SOURCE_FOR_TESTING); extensions::UNINSTALL_SOURCE_FOR_TESTING);
content::RunAllPendingInMessageLoop(); content::RunAllPendingInMessageLoop();
...@@ -223,8 +222,8 @@ IN_PROC_BROWSER_TEST_F( ...@@ -223,8 +222,8 @@ IN_PROC_BROWSER_TEST_F(
EXPECT_EQ(kUninstallUrl, GetActiveUrl(browser())); EXPECT_EQ(kUninstallUrl, GetActiveUrl(browser()));
run_loop.Run(); run_loop.Run();
// The delegate should not be canceled because the user chose to uninstall the // The delegate should not be canceled because the user chose to uninstall
// extension, which should be successful. // the extension, which should be successful.
EXPECT_TRUE(!delegate.canceled()); EXPECT_TRUE(!delegate.canceled());
} }
...@@ -387,3 +386,9 @@ IN_PROC_BROWSER_TEST_F(ExtensionUninstallDialogViewInteractiveBrowserTest, ...@@ -387,3 +386,9 @@ IN_PROC_BROWSER_TEST_F(ExtensionUninstallDialogViewInteractiveBrowserTest,
InvokeUi_UninstallByExtensionShowReportAbuse) { InvokeUi_UninstallByExtensionShowReportAbuse) {
RunTest(UNINSTALL_BY_EXTENSION, EXTENSION_FROM_WEBSTORE); RunTest(UNINSTALL_BY_EXTENSION, EXTENSION_FROM_WEBSTORE);
} }
INSTANTIATE_TEST_CASE_P(
,
ParameterizedExtensionUninstallDialogViewBrowserTest,
testing::Values(extensions::UNINSTALL_REASON_USER_INITIATED,
extensions::UNINSTALL_REASON_CHROME_WEBSTORE));
...@@ -558,7 +558,8 @@ void RuntimeEventRouter::OnExtensionUninstalled( ...@@ -558,7 +558,8 @@ void RuntimeEventRouter::OnExtensionUninstalled(
const std::string& extension_id, const std::string& extension_id,
UninstallReason reason) { UninstallReason reason) {
if (!(reason == UNINSTALL_REASON_USER_INITIATED || if (!(reason == UNINSTALL_REASON_USER_INITIATED ||
reason == UNINSTALL_REASON_MANAGEMENT_API)) { reason == UNINSTALL_REASON_MANAGEMENT_API ||
reason == UNINSTALL_REASON_CHROME_WEBSTORE)) {
return; return;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment