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

Unified Diff: chrome/browser/ui/sync/one_click_signin_sync_observer_unittest.cc

Issue 1646553002: Remove Profile dependency from some ProfileSyncService unittests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@581640_componentise_fake_invalidation_service
Patch Set: Less WaitableEvents Created 4 years, 10 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
« no previous file with comments | « chrome/browser/sync/test_profile_sync_service.cc ('k') | components/browser_sync/browser/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/sync/one_click_signin_sync_observer_unittest.cc
diff --git a/chrome/browser/ui/sync/one_click_signin_sync_observer_unittest.cc b/chrome/browser/ui/sync/one_click_signin_sync_observer_unittest.cc
index b5edd314953739110e7916cda5a4b5ae024bd3ca..efe987490a3a306da3fdd4552a032ee86d0ba696 100644
--- a/chrome/browser/ui/sync/one_click_signin_sync_observer_unittest.cc
+++ b/chrome/browser/ui/sync/one_click_signin_sync_observer_unittest.cc
@@ -4,6 +4,9 @@
#include "chrome/browser/ui/sync/one_click_signin_sync_observer.h"
+#include <string>
+#include <utility>
+
#include "base/bind.h"
#include "base/callback.h"
#include "base/macros.h"
@@ -12,6 +15,7 @@
#include "chrome/browser/signin/signin_manager_factory.h"
#include "chrome/browser/signin/signin_promo.h"
#include "chrome/browser/sync/profile_sync_service_factory.h"
+#include "chrome/browser/sync/profile_sync_test_util.h"
#include "chrome/browser/sync/test_profile_sync_service.h"
#include "chrome/test/base/chrome_render_view_host_test_harness.h"
#include "chrome/test/base/testing_profile.h"
@@ -50,8 +54,9 @@ class OneClickTestProfileSyncService : public TestProfileSyncService {
// Helper routine to be used in conjunction with
// BrowserContextKeyedServiceFactory::SetTestingFactory().
static scoped_ptr<KeyedService> Build(content::BrowserContext* profile) {
- return make_scoped_ptr(
- new OneClickTestProfileSyncService(static_cast<Profile*>(profile)));
+ return make_scoped_ptr(new OneClickTestProfileSyncService(
+ CreateProfileSyncServiceParamsForTest(
+ Profile::FromBrowserContext(profile))));
}
bool IsFirstSetupInProgress() const override {
@@ -69,17 +74,16 @@ class OneClickTestProfileSyncService : public TestProfileSyncService {
}
private:
- explicit OneClickTestProfileSyncService(Profile* profile)
- : TestProfileSyncService(
- profile,
- SigninManagerFactory::GetForProfile(profile),
- ProfileOAuth2TokenServiceFactory::GetForProfile(profile),
- browser_sync::MANUAL_START),
+ explicit OneClickTestProfileSyncService(
+ ProfileSyncService::InitParams init_params)
+ : TestProfileSyncService(std::move(init_params)),
first_setup_in_progress_(false),
sync_active_(false) {}
bool first_setup_in_progress_;
bool sync_active_;
+
+ DISALLOW_COPY_AND_ASSIGN(OneClickTestProfileSyncService);
};
class TestOneClickSigninSyncObserver : public OneClickSigninSyncObserver {
@@ -158,6 +162,8 @@ class OneClickSigninSyncObserverTest : public ChromeRenderViewHostTestHarness {
TestOneClickSigninSyncObserver* sync_observer_;
bool sync_observer_destroyed_;
+
+ DISALLOW_COPY_AND_ASSIGN(OneClickSigninSyncObserverTest);
};
// Verify that if no Sync service is present, e.g. because Sync is disabled, the
« no previous file with comments | « chrome/browser/sync/test_profile_sync_service.cc ('k') | components/browser_sync/browser/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698