OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/macros.h" | 5 #include "base/macros.h" |
6 #include "base/run_loop.h" | 6 #include "base/run_loop.h" |
7 #include "chrome/browser/extensions/extension_service.h" | 7 #include "chrome/browser/extensions/extension_service.h" |
8 #include "chrome/browser/extensions/extension_uninstall_dialog.h" | 8 #include "chrome/browser/extensions/extension_uninstall_dialog.h" |
9 #include "chrome/browser/ui/browser.h" | 9 #include "chrome/browser/ui/browser.h" |
10 #include "chrome/browser/ui/browser_window.h" | 10 #include "chrome/browser/ui/browser_window.h" |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 | 128 |
129 // Kill parent window. | 129 // Kill parent window. |
130 browser()->window()->Close(); | 130 browser()->window()->Close(); |
131 run_loop.Run(); | 131 run_loop.Run(); |
132 EXPECT_TRUE(delegate.canceled()); | 132 EXPECT_TRUE(delegate.canceled()); |
133 } | 133 } |
134 | 134 |
135 // Test that when the user clicks Uninstall on the ExtensionUninstallDialog, the | 135 // Test that when the user clicks Uninstall on the ExtensionUninstallDialog, the |
136 // extension's uninstall url (when it is specified) should open and be the | 136 // extension's uninstall url (when it is specified) should open and be the |
137 // active tab. | 137 // active tab. |
138 // DISABLED: Flaky on Win 10 x64 | 138 // TODO(catmullings): Disabled due to flake on Win 10 x64. |
| 139 // https://crbug.com/725197 |
139 IN_PROC_BROWSER_TEST_F( | 140 IN_PROC_BROWSER_TEST_F( |
140 ExtensionUninstallDialogViewBrowserTest, | 141 ExtensionUninstallDialogViewBrowserTest, |
141 DISABLED_EnsureExtensionUninstallURLIsActiveTabAfterUninstall) { | 142 DISABLED_EnsureExtensionUninstallURLIsActiveTabAfterUninstall) { |
142 scoped_refptr<extensions::Extension> extension(BuildTestExtension()); | 143 scoped_refptr<extensions::Extension> extension(BuildTestExtension()); |
143 ExtensionService* extension_service = | 144 ExtensionService* extension_service = |
144 extensions::ExtensionSystem::Get(browser()->profile()) | 145 extensions::ExtensionSystem::Get(browser()->profile()) |
145 ->extension_service(); | 146 ->extension_service(); |
146 extension_service->AddExtension(extension.get()); | 147 extension_service->AddExtension(extension.get()); |
147 SetUninstallURL( | 148 SetUninstallURL( |
148 extensions::ExtensionPrefs::Get(extension_service->GetBrowserContext()), | 149 extensions::ExtensionPrefs::Get(extension_service->GetBrowserContext()), |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 run_loop.Run(); | 183 run_loop.Run(); |
183 // The delegate should not be canceled because the user chose to uninstall the | 184 // The delegate should not be canceled because the user chose to uninstall the |
184 // extension, which should be successful. | 185 // extension, which should be successful. |
185 EXPECT_TRUE(!delegate.canceled()); | 186 EXPECT_TRUE(!delegate.canceled()); |
186 } | 187 } |
187 | 188 |
188 // Test that when the user clicks the Report Abuse checkbox and clicks Uninstall | 189 // Test that when the user clicks the Report Abuse checkbox and clicks Uninstall |
189 // on the ExtensionUninstallDialog, the extension's uninstall url (when it is | 190 // on the ExtensionUninstallDialog, the extension's uninstall url (when it is |
190 // specified) and the CWS Report Abuse survey are opened in the browser, also | 191 // specified) and the CWS Report Abuse survey are opened in the browser, also |
191 // testing that the CWS survey is the active tab. | 192 // testing that the CWS survey is the active tab. |
192 #if defined(OS_WIN) | 193 // TODO(catmullings): Disabled due to flake on Windows and Linux. |
193 // Flaky on windows: http://crbug.com/725197 | 194 // http://crbug.com/725197 |
194 #define MAYBE_EnsureCWSReportAbusePageIsActiveTabAfterUninstall \ | |
195 DISABLED_EnsureCWSReportAbusePageIsActiveTabAfterUninstall | |
196 #else | |
197 #define MAYBE_EnsureCWSReportAbusePageIsActiveTabAfterUninstall \ | |
198 EnsureCWSReportAbusePageIsActiveTabAfterUninstall | |
199 #endif | |
200 IN_PROC_BROWSER_TEST_F( | 195 IN_PROC_BROWSER_TEST_F( |
201 ExtensionUninstallDialogViewBrowserTest, | 196 ExtensionUninstallDialogViewBrowserTest, |
202 MAYBE_EnsureCWSReportAbusePageIsActiveTabAfterUninstall) { | 197 DISABLED_EnsureCWSReportAbusePageIsActiveTabAfterUninstall) { |
203 scoped_refptr<extensions::Extension> extension(BuildTestExtension()); | 198 scoped_refptr<extensions::Extension> extension(BuildTestExtension()); |
204 ExtensionService* extension_service = | 199 ExtensionService* extension_service = |
205 extensions::ExtensionSystem::Get(browser()->profile()) | 200 extensions::ExtensionSystem::Get(browser()->profile()) |
206 ->extension_service(); | 201 ->extension_service(); |
207 SetUninstallURL( | 202 SetUninstallURL( |
208 extensions::ExtensionPrefs::Get(extension_service->GetBrowserContext()), | 203 extensions::ExtensionPrefs::Get(extension_service->GetBrowserContext()), |
209 extension->id()); | 204 extension->id()); |
210 extension_service->AddExtension(extension.get()); | 205 extension_service->AddExtension(extension.get()); |
211 | 206 |
212 // Auto-confirm the uninstall dialog. | 207 // Auto-confirm the uninstall dialog. |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 ->tab_strip_model() | 244 ->tab_strip_model() |
250 ->GetWebContentsAt(1) | 245 ->GetWebContentsAt(1) |
251 ->GetLastCommittedURL() | 246 ->GetLastCommittedURL() |
252 .spec()); | 247 .spec()); |
253 | 248 |
254 run_loop.Run(); | 249 run_loop.Run(); |
255 // The delegate should not be canceled because the user chose to uninstall the | 250 // The delegate should not be canceled because the user chose to uninstall the |
256 // extension, which should be successful. | 251 // extension, which should be successful. |
257 EXPECT_TRUE(!delegate.canceled()); | 252 EXPECT_TRUE(!delegate.canceled()); |
258 } | 253 } |
OLD | NEW |