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

Unified Diff: chrome/browser/extensions/api/instance_id/instance_id_apitest.cc

Issue 1126233004: Persist Instance ID data to GCM store. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix mac Created 5 years, 7 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/extensions/api/instance_id/instance_id_api.cc ('k') | components/gcm_driver.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/instance_id/instance_id_apitest.cc
diff --git a/chrome/browser/extensions/api/instance_id/instance_id_apitest.cc b/chrome/browser/extensions/api/instance_id/instance_id_apitest.cc
index 6a3c4ab0221e173bb57d2ff625ee20d385fc9eb8..a8c00fbddd9cc333df1c28ff1945f2eb2c0360d1 100644
--- a/chrome/browser/extensions/api/instance_id/instance_id_apitest.cc
+++ b/chrome/browser/extensions/api/instance_id/instance_id_apitest.cc
@@ -12,12 +12,24 @@
#include "chrome/browser/services/gcm/instance_id/instance_id_profile_service_factory.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/test/base/ui_test_utils.h"
+#include "components/gcm_driver/instance_id/fake_gcm_driver_for_instance_id.h"
#include "extensions/test/result_catcher.h"
using extensions::ResultCatcher;
namespace extensions {
+namespace {
+
+KeyedService* BuildFakeGCMProfileService(content::BrowserContext* context) {
+ gcm::FakeGCMProfileService* service =
+ new gcm::FakeGCMProfileService(Profile::FromBrowserContext(context));
+ service->SetDriverForTesting(new instance_id::FakeGCMDriverForInstanceID());
+ return service;
+}
+
+} // namespace
+
class InstanceIDApiTest : public ExtensionApiTest {
public:
InstanceIDApiTest() {}
@@ -32,7 +44,7 @@ class InstanceIDApiTest : public ExtensionApiTest {
void InstanceIDApiTest::SetUpOnMainThread() {
gcm::GCMProfileServiceFactory::GetInstance()->SetTestingFactory(
- browser()->profile(), &gcm::FakeGCMProfileService::Build);
+ browser()->profile(), &BuildFakeGCMProfileService);
ExtensionApiTest::SetUpOnMainThread();
}
« no previous file with comments | « chrome/browser/extensions/api/instance_id/instance_id_api.cc ('k') | components/gcm_driver.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698