Commit 1336f277 authored by Colin Blundell's avatar Colin Blundell Committed by Commit Bot

Add ios/chrome FakeGaiaCookieManagerService builder

Will shortly be needed by an //ios/chrome port of
IdentityTestEnvironmentProfileAdaptor.

Bug: 895772
Change-Id: Icb7478cfc51d6bd7f6061eeab5d1ced66fe1e1a7
Reviewed-on: https://chromium-review.googlesource.com/c/1290954Reviewed-by: default avatarDavid Roger <droger@chromium.org>
Commit-Queue: Colin Blundell <blundell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#601155}
parent 72fe476e
...@@ -105,6 +105,8 @@ source_set("test_support") { ...@@ -105,6 +105,8 @@ source_set("test_support") {
"authentication_service_delegate_fake.mm", "authentication_service_delegate_fake.mm",
"authentication_service_fake.h", "authentication_service_fake.h",
"authentication_service_fake.mm", "authentication_service_fake.mm",
"fake_gaia_cookie_manager_service_builder.cc",
"fake_gaia_cookie_manager_service_builder.h",
"fake_oauth2_token_service_builder.h", "fake_oauth2_token_service_builder.h",
"fake_oauth2_token_service_builder.mm", "fake_oauth2_token_service_builder.mm",
"fake_signin_manager_builder.cc", "fake_signin_manager_builder.cc",
......
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "ios/chrome/browser/signin/fake_gaia_cookie_manager_service_builder.h"
#include "components/keyed_service/core/keyed_service.h"
#include "components/signin/core/browser/fake_gaia_cookie_manager_service.h"
#include "components/signin/core/browser/profile_oauth2_token_service.h"
#include "google_apis/gaia/gaia_constants.h"
#include "ios/chrome/browser/browser_state/chrome_browser_state.h"
#include "ios/chrome/browser/signin/profile_oauth2_token_service_factory.h"
#include "ios/chrome/browser/signin/signin_client_factory.h"
std::unique_ptr<KeyedService> BuildFakeGaiaCookieManagerService(
web::BrowserState* browser_state) {
ios::ChromeBrowserState* chrome_browser_state =
ios::ChromeBrowserState::FromBrowserState(browser_state);
return std::make_unique<FakeGaiaCookieManagerService>(
ProfileOAuth2TokenServiceFactory::GetForBrowserState(
chrome_browser_state),
GaiaConstants::kChromeSource,
SigninClientFactory::GetForBrowserState(chrome_browser_state));
}
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef IOS_CHROME_BROWSER_SIGNIN_FAKE_GAIA_COOKIE_MANAGER_SERVICE_BUILDER_H_
#define IOS_CHROME_BROWSER_SIGNIN_FAKE_GAIA_COOKIE_MANAGER_SERVICE_BUILDER_H_
#include <memory>
class KeyedService;
namespace web {
class BrowserState;
}
// Helper functions to be used with KeyedService::SetTestingFactory().
std::unique_ptr<KeyedService> BuildFakeGaiaCookieManagerService(
web::BrowserState* browser_state);
#endif // IOS_CHROME_BROWSER_SIGNIN_FAKE_GAIA_COOKIE_MANAGER_SERVICE_BUILDER_H_
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment