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

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

Issue 1425783002: Componentizing GcmProfileService. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix UT errors as per comments Created 5 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/extension_gcm_app_handler_unittest.cc
diff --git a/chrome/browser/extensions/extension_gcm_app_handler_unittest.cc b/chrome/browser/extensions/extension_gcm_app_handler_unittest.cc
index 59737ca44214de995f700e2dd4a65c885fc3e936..c51beec8a9b8bdad7c0537ae8244695b799427e0 100644
--- a/chrome/browser/extensions/extension_gcm_app_handler_unittest.cc
+++ b/chrome/browser/extensions/extension_gcm_app_handler_unittest.cc
@@ -26,8 +26,11 @@
#include "chrome/browser/extensions/test_extension_service.h"
#include "chrome/browser/extensions/test_extension_system.h"
#include "chrome/browser/profiles/profile.h"
-#include "chrome/browser/services/gcm/gcm_profile_service.h"
#include "chrome/browser/services/gcm/gcm_profile_service_factory.h"
+#include "chrome/browser/signin/profile_oauth2_token_service_factory.h"
+#include "chrome/browser/signin/signin_manager_factory.h"
+#include "chrome/browser/ui/webui/signin/login_ui_service_factory.h"
+#include "chrome/common/channel_info.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/test/base/testing_profile.h"
#include "components/gcm_driver/fake_gcm_app_handler.h"
@@ -35,7 +38,9 @@
#include "components/gcm_driver/fake_gcm_client_factory.h"
#include "components/gcm_driver/gcm_client_factory.h"
#include "components/gcm_driver/gcm_driver.h"
+#include "components/gcm_driver/gcm_profile_service.h"
#include "components/keyed_service/core/keyed_service.h"
+#include "components/signin/core/browser/signin_manager.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/test/test_browser_thread_bundle.h"
@@ -190,13 +195,29 @@ class ExtensionGCMAppHandlerTest : public testing::Test {
public:
static scoped_ptr<KeyedService> BuildGCMProfileService(
content::BrowserContext* context) {
+ Profile* profile = Profile::FromBrowserContext(context);
+ scoped_refptr<base::SequencedTaskRunner> ui_thread =
+ content::BrowserThread::GetMessageLoopProxyForThread(
+ content::BrowserThread::UI);
+ scoped_refptr<base::SequencedTaskRunner> io_thread =
+ content::BrowserThread::GetMessageLoopProxyForThread(
+ content::BrowserThread::IO);
+ base::SequencedWorkerPool* worker_pool =
+ content::BrowserThread::GetBlockingPool();
+ scoped_refptr<base::SequencedTaskRunner> blocking_task_runner(
+ worker_pool->GetSequencedTaskRunnerWithShutdownBehavior(
+ worker_pool->GetSequenceToken(),
+ base::SequencedWorkerPool::SKIP_ON_SHUTDOWN));
return make_scoped_ptr(new gcm::GCMProfileService(
- Profile::FromBrowserContext(context),
- scoped_ptr<gcm::GCMClientFactory>(new gcm::FakeGCMClientFactory(
- content::BrowserThread::GetMessageLoopProxyForThread(
- content::BrowserThread::UI),
- content::BrowserThread::GetMessageLoopProxyForThread(
- content::BrowserThread::IO)))));
+ profile->GetPrefs(), profile->GetPath(), profile->GetRequestContext(),
+ chrome::GetChannel(),
+ scoped_ptr<ProfileIdentityProvider>(new ProfileIdentityProvider(
+ SigninManagerFactory::GetForProfile(profile),
+ ProfileOAuth2TokenServiceFactory::GetForProfile(profile),
+ LoginUIServiceFactory::GetShowLoginPopupCallbackForProfile(
+ profile))),
+ make_scoped_ptr(new gcm::FakeGCMClientFactory(ui_thread, io_thread)),
+ ui_thread, io_thread, blocking_task_runner));
}
ExtensionGCMAppHandlerTest()

Powered by Google App Engine
This is Rietveld 408576698