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

Side by Side 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, 5 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
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 "chrome/browser/extensions/webstore_inline_installer.h" 5 #include "chrome/browser/extensions/webstore_inline_installer.h"
6 6
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" 10 #include "chrome/browser/content_settings/host_content_settings_map_factory.h"
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 RunTest("install_stage_listener.html"); 328 RunTest("install_stage_listener.html");
329 } 329 }
330 330
331 IN_PROC_BROWSER_TEST_F(WebstoreInlineInstallerListenerTest, 331 IN_PROC_BROWSER_TEST_F(WebstoreInlineInstallerListenerTest,
332 DownloadProgressListenerTest) { 332 DownloadProgressListenerTest) {
333 RunTest("download_progress_listener.html"); 333 RunTest("download_progress_listener.html");
334 } 334 }
335 335
336 IN_PROC_BROWSER_TEST_F(WebstoreInlineInstallerListenerTest, BothListenersTest) { 336 IN_PROC_BROWSER_TEST_F(WebstoreInlineInstallerListenerTest, BothListenersTest) {
337 RunTest("both_listeners.html"); 337 RunTest("both_listeners.html");
338 // The extension should be installed.
339 ExtensionRegistry* registry = ExtensionRegistry::Get(profile());
340 EXPECT_TRUE(registry->enabled_extensions().GetByID(kTestExtensionId));
341
342 // Rinse and repeat: uninstall the extension, open a new tab, and install it
343 // again. Regression test for crbug.com/613949.
344 extension_service()->UninstallExtension(
345 kTestExtensionId,
346 UNINSTALL_REASON_FOR_TESTING,
347 base::Bind(&base::DoNothing),
348 nullptr);
349 base::RunLoop().RunUntilIdle();
350 EXPECT_FALSE(registry->enabled_extensions().GetByID(kTestExtensionId));
351 int old_tab_index = browser()->tab_strip_model()->active_index();
352 ui_test_utils::NavigateToURLWithDisposition(
353 browser(),
354 GenerateTestServerUrl(kAppDomain, "both_listeners.html"),
355 NEW_FOREGROUND_TAB,
356 ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION);
357 DCHECK_NE(old_tab_index, browser()->tab_strip_model()->active_index());
358 browser()->tab_strip_model()->CloseWebContentsAt(
359 old_tab_index, TabStripModel::CLOSE_NONE);
360 WebstoreInstallerTest::RunTest("runTest");
361 EXPECT_TRUE(registry->enabled_extensions().GetByID(kTestExtensionId));
338 } 362 }
339 363
340 } // namespace extensions 364 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698