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

Unified Diff: chrome/browser/sync/test/integration/two_client_apps_sync_test.cc

Issue 349073004: Cleanup: Remove deprecated Profile::GetExtensionService(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix typo Created 6 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/sync/test/integration/two_client_apps_sync_test.cc
diff --git a/chrome/browser/sync/test/integration/two_client_apps_sync_test.cc b/chrome/browser/sync/test/integration/two_client_apps_sync_test.cc
index 2a05ad9bfe70556ca53db747b4b8d8a164888667..5649cceedc4b80b48e9692b44c9bc6d45413f244 100644
--- a/chrome/browser/sync/test/integration/two_client_apps_sync_test.cc
+++ b/chrome/browser/sync/test/integration/two_client_apps_sync_test.cc
@@ -22,6 +22,7 @@
#include "extensions/browser/app_sorting.h"
#include "extensions/browser/extension_prefs.h"
#include "extensions/browser/extension_registry.h"
+#include "extensions/browser/extension_system.h"
#include "sync/api/string_ordinal.h"
using apps_helper::AllProfilesHaveSameAppsAsVerifier;
@@ -41,6 +42,18 @@ using apps_helper::SetPageOrdinalForApp;
using apps_helper::UninstallApp;
using sync_integration_test_util::AwaitCommitActivityCompletion;
+namespace {
+
+extensions::ExtensionRegistry* GetExtensionRegistry(Profile* profile) {
+ return extensions::ExtensionRegistry::Get(profile);
+}
+
+ExtensionService* GetExtensionService(Profile* profile) {
+ return extensions::ExtensionSystem::Get(profile)->extension_service();
+}
+
+} // namespace
+
class TwoClientAppsSyncTest : public SyncTest {
public:
TwoClientAppsSyncTest() : SyncTest(TWO_CLIENT) {}
@@ -451,21 +464,21 @@ IN_PROC_BROWSER_TEST_F(TwoClientAppsSyncTest, UpdateLaunchType) {
ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier());
// Change the launch type to window.
- extensions::SetLaunchType(GetProfile(1)->GetExtensionService(),
+ extensions::SetLaunchType(GetExtensionService(GetProfile(1)),
extension_misc::kWebStoreAppId,
extensions::LAUNCH_TYPE_WINDOW);
- extensions::SetLaunchType(verifier()->GetExtensionService(),
+ extensions::SetLaunchType(GetExtensionService(verifier()),
extension_misc::kWebStoreAppId,
extensions::LAUNCH_TYPE_WINDOW);
ASSERT_TRUE(AwaitQuiescence());
ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier());
// Change the launch type to regular tab.
- extensions::SetLaunchType(GetProfile(1)->GetExtensionService(),
+ extensions::SetLaunchType(GetExtensionService(GetProfile(1)),
extension_misc::kWebStoreAppId,
extensions::LAUNCH_TYPE_REGULAR);
ASSERT_FALSE(HasSameAppsAsVerifier(1));
- extensions::SetLaunchType(verifier()->GetExtensionService(),
+ extensions::SetLaunchType(GetExtensionService(verifier()),
extension_misc::kWebStoreAppId,
extensions::LAUNCH_TYPE_REGULAR);
ASSERT_TRUE(AwaitQuiescence());
@@ -476,18 +489,19 @@ IN_PROC_BROWSER_TEST_F(TwoClientAppsSyncTest, UnexpectedLaunchType) {
ASSERT_TRUE(SetupSync());
ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier());
- extensions::SetLaunchType(GetProfile(1)->GetExtensionService(),
+ extensions::SetLaunchType(GetExtensionService(GetProfile(1)),
extension_misc::kWebStoreAppId,
extensions::LAUNCH_TYPE_REGULAR);
- extensions::SetLaunchType(verifier()->GetExtensionService(),
+ extensions::SetLaunchType(GetExtensionService(verifier()),
extension_misc::kWebStoreAppId,
extensions::LAUNCH_TYPE_REGULAR);
ASSERT_TRUE(AwaitQuiescence());
ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier());
const extensions::Extension* extension =
- GetProfile(1)->GetExtensionService()->
- GetInstalledExtension(extension_misc::kWebStoreAppId);
+ GetExtensionRegistry(GetProfile(1))->GetExtensionById(
+ extension_misc::kWebStoreAppId,
+ extensions::ExtensionRegistry::EVERYTHING);
ASSERT_TRUE(extension);
ExtensionSyncService* extension_sync_service =
@@ -519,7 +533,7 @@ IN_PROC_BROWSER_TEST_F(TwoClientAppsSyncTest, BookmarkApp) {
ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier());
size_t num_extensions =
- GetProfile(0)->GetExtensionService()->extensions()->size();
+ GetExtensionRegistry(GetProfile(0))->enabled_extensions().size();
WebApplicationInfo web_app_info;
web_app_info.app_url = GURL("http://www.chromium.org");
@@ -530,25 +544,21 @@ IN_PROC_BROWSER_TEST_F(TwoClientAppsSyncTest, BookmarkApp) {
content::WindowedNotificationObserver windowed_observer(
chrome::NOTIFICATION_CRX_INSTALLER_DONE,
content::NotificationService::AllSources());
- extensions::CreateOrUpdateBookmarkApp(GetProfile(0)->GetExtensionService(),
+ extensions::CreateOrUpdateBookmarkApp(GetExtensionService(GetProfile(0)),
web_app_info);
windowed_observer.Wait();
EXPECT_EQ(num_extensions,
- extensions::ExtensionRegistry::Get(GetProfile(0))
- ->enabled_extensions()
- .size());
+ GetExtensionRegistry(GetProfile(0))->enabled_extensions().size());
}
{
content::WindowedNotificationObserver windowed_observer(
chrome::NOTIFICATION_CRX_INSTALLER_DONE,
content::NotificationService::AllSources());
- extensions::CreateOrUpdateBookmarkApp(verifier()->GetExtensionService(),
+ extensions::CreateOrUpdateBookmarkApp(GetExtensionService(verifier()),
web_app_info);
windowed_observer.Wait();
EXPECT_EQ(num_extensions,
- extensions::ExtensionRegistry::Get(verifier())
- ->enabled_extensions()
- .size());
+ GetExtensionRegistry(verifier())->enabled_extensions().size());
}
{
// Wait for the synced app to install.
« no previous file with comments | « chrome/browser/speech/tts_extension_loader_chromeos.cc ('k') | chrome/browser/ui/app_list/test/fake_profile.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698