Converted OAuth2AccessTokenFetcher to using SimplerURLLoader.
This impacted a lot of APIs that now need to be provided with a
SharedURLLoaderFactory. Note that in many of these APIs we still need
also the net::URLRequestContextGetter as other GAIA requests still use
the networ API directly. Once all GAIA code uses the network service,
all APIs will be changed to only take the SharedURLLoaderFactory.
Many tests that simulate URL responses had to be changed and use a
TestURLLoaderFactory. In some instances, we need the
TestURLLoaderFactory for the OAuth token but still mock the URLRequests
directly for other operations.
Also:
- split up OAuth2AccessTokenFetcherImplTest.MakeGetAccessTokenBody
into smaller tests
- exposing ways to simulate URL responses directly in
TestURLLoaderFactory as it was required by some tests
Bug: 840396
Cq-Include-Trybots: luci.chromium.try:ios-simulator-full-configs;luci.chromium.try:linux_mojo;master.tryserver.chromium.mac:ios-simulator-cronet
Change-Id: I6d1d1081238aa5e1d8dc5f1469e4c752c93729fc
Reviewed-on: https://chromium-review.googlesource.com/1096309
Commit-Queue: John Abd-El-Malek <[email protected]>
Reviewed-by: Maksim Ivanov <[email protected]>
Reviewed-by: John Abd-El-Malek <[email protected]>
Reviewed-by: Mattias Nissler <[email protected]>
Reviewed-by: Roger Tawa <[email protected]>
Cr-Commit-Position: refs/heads/master@{#569408}
diff --git a/chrome/browser/browser_process_impl.cc b/chrome/browser/browser_process_impl.cc
index 8c98e72d..a02e15b 100644
--- a/chrome/browser/browser_process_impl.cc
+++ b/chrome/browser/browser_process_impl.cc
@@ -1130,7 +1130,9 @@
// requires that threads are running; this Init() call lets the connector
// resume its initialization now that the loops are spinning and the
// system request context is available for the fetchers.
- browser_policy_connector()->Init(local_state(), system_request_context());
+ browser_policy_connector()->Init(
+ local_state(), system_request_context(),
+ system_network_context_manager()->GetSharedURLLoaderFactory());
if (local_state_->IsManagedPreference(prefs::kDefaultBrowserSettingEnabled))
ApplyDefaultBrowserPolicy();