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

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: rebase 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..45247da64e5519859f643ccd3a2ee42c130575bf 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,14 @@ using apps_helper::SetPageOrdinalForApp;
using apps_helper::UninstallApp;
using sync_integration_test_util::AwaitCommitActivityCompletion;
+namespace {
+
+ExtensionService* GetExtensionService(Profile* profile) {
+ return extensions::ExtensionSystem::Get(profile)->extension_service();
+}
+
+} // namespace
+
class TwoClientAppsSyncTest : public SyncTest {
public:
TwoClientAppsSyncTest() : SyncTest(TWO_CLIENT) {}
@@ -451,21 +460,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 +485,18 @@ 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);
+ GetExtensionService(GetProfile(1))->GetInstalledExtension(
Devlin 2014/06/25 19:38:48 nit: ExtensionRegistry::GetExtensionById(id, Exten
Lei Zhang 2014/06/25 19:58:31 Done.
+ extension_misc::kWebStoreAppId);
ASSERT_TRUE(extension);
ExtensionSyncService* extension_sync_service =
@@ -519,7 +528,7 @@ IN_PROC_BROWSER_TEST_F(TwoClientAppsSyncTest, BookmarkApp) {
ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier());
size_t num_extensions =
- GetProfile(0)->GetExtensionService()->extensions()->size();
+ GetExtensionService(GetProfile(0))->extensions()->size();
Devlin 2014/06/25 19:38:48 nit: ExtensionRegistry::enabled_extensions().size(
Lei Zhang 2014/06/25 19:58:31 Done.
WebApplicationInfo web_app_info;
web_app_info.app_url = GURL("http://www.chromium.org");
@@ -530,7 +539,7 @@ 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,
@@ -542,7 +551,7 @@ IN_PROC_BROWSER_TEST_F(TwoClientAppsSyncTest, BookmarkApp) {
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,

Powered by Google App Engine
This is Rietveld 408576698