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

Unified Diff: chrome/browser/extensions/webstore_startup_installer_browsertest.cc

Issue 709813004: Remove the deprecated function ExtensionService::extensions(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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_startup_installer_browsertest.cc
diff --git a/chrome/browser/extensions/webstore_startup_installer_browsertest.cc b/chrome/browser/extensions/webstore_startup_installer_browsertest.cc
index a67482d7de49b30c31e2314fdd06c3bee617b413..726c40a4c4ec6c90041359abd45ff478522e83dd 100644
--- a/chrome/browser/extensions/webstore_startup_installer_browsertest.cc
+++ b/chrome/browser/extensions/webstore_startup_installer_browsertest.cc
@@ -36,6 +36,7 @@ using content::WebContents;
using extensions::DictionaryBuilder;
using extensions::Extension;
using extensions::ExtensionBuilder;
+using extensions::ExtensionRegistry;
using extensions::ListBuilder;
const char kWebstoreDomain[] = "cws.com";
@@ -66,8 +67,8 @@ IN_PROC_BROWSER_TEST_F(WebstoreStartupInstallerTest, Install) {
RunTest("runTest");
const extensions::Extension* extension =
- extensions::ExtensionRegistry::Get(
- browser()->profile())->enabled_extensions().GetByID(kTestExtensionId);
+ ExtensionRegistry::Get(browser()->profile())
+ ->GetExtensionById(kTestExtensionId, ExtensionRegistry::ENABLED);
EXPECT_TRUE(extension);
}
@@ -162,15 +163,19 @@ IN_PROC_BROWSER_TEST_F(WebstoreStartupInstallerTest, InstallFromHostedApp) {
ExtensionService* extension_service =
extensions::ExtensionSystem::Get(browser()->profile())->
extension_service();
+ ExtensionRegistry* registry = ExtensionRegistry::Get(browser()->profile());
extension_service->AddExtension(hosted_app.get());
- EXPECT_TRUE(extension_service->extensions()->Contains(hosted_app->id()));
+ EXPECT_TRUE(registry->GetExtensionById(
+ hosted_app->id(), ExtensionRegistry::ENABLED));
ui_test_utils::NavigateToURL(browser(), kInstallUrl);
- EXPECT_FALSE(extension_service->extensions()->Contains(kTestExtensionId));
+ EXPECT_FALSE(registry->GetExtensionById(
+ kTestExtensionId, ExtensionRegistry::ENABLED));
RunTest("runTest");
- EXPECT_TRUE(extension_service->extensions()->Contains(kTestExtensionId));
+ EXPECT_TRUE(registry->GetExtensionById(
+ kTestExtensionId, ExtensionRegistry::ENABLED));
}
class WebstoreStartupInstallerSupervisedUsersTest
@@ -247,14 +252,13 @@ class CommandLineWebstoreInstall
void SetUpOnMainThread() override {
WebstoreStartupInstallerTest::SetUpOnMainThread();
- extensions::ExtensionRegistry::Get(browser()->profile())->AddObserver(this);
+ ExtensionRegistry::Get(browser()->profile())->AddObserver(this);
registrar_.Add(this, chrome::NOTIFICATION_BROWSER_OPENED,
content::NotificationService::AllSources());
}
void TearDownOnMainThread() override {
- extensions::ExtensionRegistry::Get(browser()->profile())
- ->RemoveObserver(this);
+ ExtensionRegistry::Get(browser()->profile())->RemoveObserver(this);
WebstoreStartupInstallerTest::TearDownOnMainThread();
}

Powered by Google App Engine
This is Rietveld 408576698