Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / sync / profile_sync_service_session_unittest.cc
index 61f4660..a0684cf 100644 (file)
@@ -20,6 +20,7 @@
 #include "chrome/browser/invalidation/invalidation_service_factory.h"
 #include "chrome/browser/sessions/session_tab_helper.h"
 #include "chrome/browser/signin/fake_profile_oauth2_token_service.h"
+#include "chrome/browser/signin/fake_profile_oauth2_token_service_wrapper.h"
 #include "chrome/browser/signin/profile_oauth2_token_service.h"
 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h"
 #include "chrome/browser/signin/signin_manager.h"
@@ -115,6 +116,11 @@ bool CompareMemoryToString(
   return true;
 }
 
+ACTION_P(ReturnSyncBackendHost, callback) {
+  return new browser_sync::SyncBackendHostForProfileSyncTest(
+      arg1, arg2, callback);
+}
+
 }  // namespace
 
 class ProfileSyncServiceSessionTest
@@ -132,7 +138,7 @@ class ProfileSyncServiceSessionTest
     TestingProfile::Builder builder;
     builder.AddTestingFactory(
         ProfileOAuth2TokenServiceFactory::GetInstance(),
-        FakeProfileOAuth2TokenService::BuildAutoIssuingTokenService);
+        FakeProfileOAuth2TokenServiceWrapper::BuildAutoIssuingTokenService);
     // Don't want the profile to create a real ProfileSyncService.
     builder.AddTestingFactory(ProfileSyncServiceFactory::GetInstance(), NULL);
     scoped_ptr<TestingProfile> profile(builder.Build());
@@ -200,7 +206,8 @@ class ProfileSyncServiceSessionTest
         signin,
         oauth2_token_service,
         ProfileSyncService::AUTO_START));
-    sync_service_->set_backend_init_callback(callback);
+    EXPECT_CALL(*factory, CreateSyncBackendHost(_,_,_)).
+        WillOnce(ReturnSyncBackendHost(callback));
 
     // Register the session data type.
     SessionDataTypeController *dtc = new SessionDataTypeController(factory,