| OLD | NEW |
| 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 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 350 // Rinse and repeat: uninstall the extension, open a new tab, and install it | 350 // Rinse and repeat: uninstall the extension, open a new tab, and install it |
| 351 // again. Regression test for crbug.com/613949. | 351 // again. Regression test for crbug.com/613949. |
| 352 extension_service()->UninstallExtension( | 352 extension_service()->UninstallExtension( |
| 353 kTestExtensionId, UNINSTALL_REASON_FOR_TESTING, | 353 kTestExtensionId, UNINSTALL_REASON_FOR_TESTING, |
| 354 base::Bind(&base::DoNothing), nullptr); | 354 base::Bind(&base::DoNothing), nullptr); |
| 355 base::RunLoop().RunUntilIdle(); | 355 base::RunLoop().RunUntilIdle(); |
| 356 EXPECT_FALSE(registry->enabled_extensions().GetByID(kTestExtensionId)); | 356 EXPECT_FALSE(registry->enabled_extensions().GetByID(kTestExtensionId)); |
| 357 int old_tab_index = browser()->tab_strip_model()->active_index(); | 357 int old_tab_index = browser()->tab_strip_model()->active_index(); |
| 358 ui_test_utils::NavigateToURLWithDisposition( | 358 ui_test_utils::NavigateToURLWithDisposition( |
| 359 browser(), GenerateTestServerUrl(kAppDomain, "both_listeners.html"), | 359 browser(), GenerateTestServerUrl(kAppDomain, "both_listeners.html"), |
| 360 NEW_FOREGROUND_TAB, ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION); | 360 WindowOpenDisposition::NEW_FOREGROUND_TAB, |
| 361 ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION); |
| 361 DCHECK_NE(old_tab_index, browser()->tab_strip_model()->active_index()); | 362 DCHECK_NE(old_tab_index, browser()->tab_strip_model()->active_index()); |
| 362 browser()->tab_strip_model()->CloseWebContentsAt(old_tab_index, | 363 browser()->tab_strip_model()->CloseWebContentsAt(old_tab_index, |
| 363 TabStripModel::CLOSE_NONE); | 364 TabStripModel::CLOSE_NONE); |
| 364 WebstoreInstallerTest::RunTest("runTest"); | 365 WebstoreInstallerTest::RunTest("runTest"); |
| 365 EXPECT_TRUE(registry->enabled_extensions().GetByID(kTestExtensionId)); | 366 EXPECT_TRUE(registry->enabled_extensions().GetByID(kTestExtensionId)); |
| 366 } | 367 } |
| 367 | 368 |
| 368 } // namespace extensions | 369 } // namespace extensions |
| OLD | NEW |