Commit 3469e50e authored by Xiaoqian Dai's avatar Xiaoqian Dai Committed by Commit Bot

Revert "Migrate ServicesCustomizationDocument to SimpleURLLoader"

This reverts commit 07b983e8.

Reason for revert: It broken the chrome caroline-information pfq build and reef chrome pfq. See crbug.com/820302 for details.

Bug: 820302

Original change's description:
> Migrate ServicesCustomizationDocument to SimpleURLLoader
> 
> update to https://chromium-review.googlesource.com/c/chromium/src/+/884063
> 
> Bug: 773295
> Change-Id: Iba3ea07f19034bf9a1ea2c75876cac5d28297486
> Reviewed-on: https://chromium-review.googlesource.com/956291
> Reviewed-by: James Cook <jamescook@chromium.org>
> Reviewed-by: Matt Menke <mmenke@chromium.org>
> Commit-Queue: Mark Pilgrim <pilgrim@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#542180}

TBR=jamescook@chromium.org,mmenke@chromium.org,pilgrim@chromium.org

Change-Id: I529f57fc99d56d48068af69a4722f28425e76d77
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 773295
Reviewed-on: https://chromium-review.googlesource.com/957744Reviewed-by: default avatarXiaoqian Dai <xdai@chromium.org>
Commit-Queue: Xiaoqian Dai <xdai@chromium.org>
Cr-Commit-Position: refs/heads/master@{#542379}
parent 14b7c924
...@@ -130,7 +130,6 @@ source_set("chromeos") { ...@@ -130,7 +130,6 @@ source_set("chromeos") {
"//components/viz/host", "//components/viz/host",
"//services/identity/public/cpp", "//services/identity/public/cpp",
"//services/metrics/public/cpp:ukm_builders", "//services/metrics/public/cpp:ukm_builders",
"//services/network:network_service",
"//services/resource_coordinator/public/cpp:resource_coordinator_cpp", "//services/resource_coordinator/public/cpp:resource_coordinator_cpp",
"//third_party/fontconfig", "//third_party/fontconfig",
"//third_party/metrics_proto", "//third_party/metrics_proto",
......
...@@ -27,7 +27,6 @@ include_rules = [ ...@@ -27,7 +27,6 @@ include_rules = [
"+mojo/edk/embedder", "+mojo/edk/embedder",
"+services/device/public", "+services/device/public",
"+services/metrics/public", "+services/metrics/public",
"+services/network",
"+services/tracing/public", "+services/tracing/public",
"+services/viz/public/interfaces", "+services/viz/public/interfaces",
# Chromeos should not use ozone directly, it must go through mojo as ozone # Chromeos should not use ozone directly, it must go through mojo as ozone
......
...@@ -34,7 +34,6 @@ ...@@ -34,7 +34,6 @@
#include "chrome/browser/chromeos/net/delay_network_call.h" #include "chrome/browser/chromeos/net/delay_network_call.h"
#include "chrome/browser/extensions/external_loader.h" #include "chrome/browser/extensions/external_loader.h"
#include "chrome/browser/extensions/external_provider_impl.h" #include "chrome/browser/extensions/external_provider_impl.h"
#include "chrome/browser/net/system_network_context_manager.h"
#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/app_list/app_list_syncable_service.h" #include "chrome/browser/ui/app_list/app_list_syncable_service.h"
#include "chrome/browser/ui/app_list/app_list_syncable_service_factory.h" #include "chrome/browser/ui/app_list/app_list_syncable_service_factory.h"
...@@ -45,14 +44,11 @@ ...@@ -45,14 +44,11 @@
#include "components/prefs/pref_registry_simple.h" #include "components/prefs/pref_registry_simple.h"
#include "components/prefs/pref_service.h" #include "components/prefs/pref_service.h"
#include "content/public/browser/browser_thread.h" #include "content/public/browser/browser_thread.h"
#include "content/public/browser/storage_partition.h"
#include "extensions/common/extension_urls.h" #include "extensions/common/extension_urls.h"
#include "net/base/load_flags.h" #include "net/base/load_flags.h"
#include "net/http/http_response_headers.h" #include "net/http/http_response_headers.h"
#include "net/http/http_status_code.h" #include "net/http/http_status_code.h"
#include "services/network/public/cpp/resource_request.h" #include "net/url_request/url_fetcher.h"
#include "services/network/public/cpp/simple_url_loader.h"
#include "services/network/url_loader_factory.h"
namespace chromeos { namespace chromeos {
namespace { namespace {
...@@ -574,41 +570,14 @@ void ServicesCustomizationDocument::StartFileFetch() { ...@@ -574,41 +570,14 @@ void ServicesCustomizationDocument::StartFileFetch() {
} }
void ServicesCustomizationDocument::DoStartFileFetch() { void ServicesCustomizationDocument::DoStartFileFetch() {
net::NetworkTrafficAnnotationTag traffic_annotation = url_fetcher_ = net::URLFetcher::Create(url_, net::URLFetcher::GET, this);
net::DefineNetworkTrafficAnnotation("chromeos_customization_document", R"( url_fetcher_->SetRequestContext(g_browser_process->system_request_context());
semantics { url_fetcher_->AddExtraRequestHeader("Accept: application/json");
sender: "Chrome OS Services Customization" url_fetcher_->SetLoadFlags(net::LOAD_DO_NOT_SEND_COOKIES |
description: net::LOAD_DO_NOT_SAVE_COOKIES |
"Chrome OS downloads the OEM services customization manifest." net::LOAD_DISABLE_CACHE |
trigger: net::LOAD_DO_NOT_SEND_AUTH_DATA);
"When a public session starts on managed devices and an OEM " url_fetcher_->Start();
"has uploaded a service customization document."
data:
"URL of the OEM service customization document. "
"No user information is sent."
destination: WEBSITE
}
policy {
cookies_allowed: NO
setting: "Unconditionally enabled on Chrome OS."
})");
auto resource_request = std::make_unique<network::ResourceRequest>();
resource_request->url = url_;
resource_request->load_flags =
net::LOAD_DO_NOT_SEND_COOKIES | net::LOAD_DO_NOT_SAVE_COOKIES |
net::LOAD_DISABLE_CACHE | net::LOAD_DO_NOT_SEND_AUTH_DATA;
resource_request->headers.SetHeader("Accept", "application/json");
simple_loader_ = network::SimpleURLLoader::Create(std::move(resource_request),
traffic_annotation);
network::mojom::URLLoaderFactory* loader_factory = url_loader_factory_;
if (!loader_factory) {
loader_factory = g_browser_process->system_network_context_manager()
->GetURLLoaderFactory();
}
simple_loader_->DownloadToStringOfUnboundedSizeUntilCrashAndDie(
loader_factory,
base::BindOnce(&ServicesCustomizationDocument::OnSimpleLoaderComplete,
base::Unretained(this)));
} }
bool ServicesCustomizationDocument::LoadManifestFromString( bool ServicesCustomizationDocument::LoadManifestFromString(
...@@ -640,30 +609,26 @@ void ServicesCustomizationDocument::OnManifestLoaded() { ...@@ -640,30 +609,26 @@ void ServicesCustomizationDocument::OnManifestLoaded() {
} }
} }
void ServicesCustomizationDocument::OnSimpleLoaderComplete( void ServicesCustomizationDocument::OnURLFetchComplete(
std::unique_ptr<std::string> response_body) { const net::URLFetcher* source) {
int response_code = 0; std::string mime_type;
bool retry = true; std::string data;
if (simple_loader_->ResponseInfo() && if (source->GetStatus().is_success() &&
simple_loader_->ResponseInfo()->headers) { source->GetResponseCode() == net::HTTP_OK &&
response_code = simple_loader_->ResponseInfo()->headers->response_code(); source->GetResponseHeaders()->GetMimeType(&mime_type) &&
std::string mime_type; mime_type == "application/json" &&
simple_loader_->ResponseInfo()->headers->GetMimeType(&mime_type); source->GetResponseAsString(&data)) {
if (mime_type == "application/json" and response_body) { LoadManifestFromString(data);
LoadManifestFromString(*response_body); } else if (source->GetResponseCode() == net::HTTP_NOT_FOUND) {
retry = false; LOG(ERROR) << "Customization manifest is missing on server: "
} else if (response_code == net::HTTP_NOT_FOUND) { << source->GetURL().spec();
LOG(ERROR) << "Customization manifest is missing on server: " OnCustomizationNotFound();
<< url_.spec(); } else {
OnCustomizationNotFound();
retry = false;
}
}
if (retry) {
if (num_retries_ < kMaxFetchRetries) { if (num_retries_ < kMaxFetchRetries) {
num_retries_++; num_retries_++;
content::BrowserThread::PostDelayedTask( content::BrowserThread::PostDelayedTask(
content::BrowserThread::UI, FROM_HERE, content::BrowserThread::UI,
FROM_HERE,
base::Bind(&ServicesCustomizationDocument::StartFileFetch, base::Bind(&ServicesCustomizationDocument::StartFileFetch,
weak_ptr_factory_.GetWeakPtr()), weak_ptr_factory_.GetWeakPtr()),
base::TimeDelta::FromSeconds(kRetriesDelayInSec)); base::TimeDelta::FromSeconds(kRetriesDelayInSec));
...@@ -671,8 +636,8 @@ void ServicesCustomizationDocument::OnSimpleLoaderComplete( ...@@ -671,8 +636,8 @@ void ServicesCustomizationDocument::OnSimpleLoaderComplete(
} }
// This doesn't stop fetching manifest on next restart. // This doesn't stop fetching manifest on next restart.
LOG(ERROR) << "URL fetch for services customization failed:" LOG(ERROR) << "URL fetch for services customization failed:"
<< " response code = " << response_code << " response code = " << source->GetResponseCode()
<< " URL = " << url_.spec(); << " URL = " << source->GetURL().spec();
LogManifestLoadResult(HISTOGRAM_LOAD_RESULT_RETRIES_FAIL); LogManifestLoadResult(HISTOGRAM_LOAD_RESULT_RETRIES_FAIL);
} }
...@@ -812,8 +777,8 @@ void ServicesCustomizationDocument::SetOemFolderName( ...@@ -812,8 +777,8 @@ void ServicesCustomizationDocument::SetOemFolderName(
std::string ServicesCustomizationDocument::GetOemAppsFolderNameImpl( std::string ServicesCustomizationDocument::GetOemAppsFolderNameImpl(
const std::string& locale, const std::string& locale,
const base::DictionaryValue& root) const { const base::DictionaryValue& root) const {
return GetLocaleSpecificStringImpl(&root, locale, kLocalizedContent, return GetLocaleSpecificStringImpl(
kDefaultAppsFolderName); &root, locale, kLocalizedContent, kDefaultAppsFolderName);
} }
// static // static
...@@ -886,9 +851,10 @@ void ServicesCustomizationDocument::CheckAndApplyWallpaper() { ...@@ -886,9 +851,10 @@ void ServicesCustomizationDocument::CheckAndApplyWallpaper() {
std::unique_ptr<bool> exists(new bool(false)); std::unique_ptr<bool> exists(new bool(false));
base::Closure check_file_exists = base::Bind( base::Closure check_file_exists =
&CheckWallpaperCacheExists, GetCustomizedWallpaperDownloadedFileName(), base::Bind(&CheckWallpaperCacheExists,
base::Unretained(exists.get())); GetCustomizedWallpaperDownloadedFileName(),
base::Unretained(exists.get()));
base::Closure on_checked_closure = base::Bind( base::Closure on_checked_closure = base::Bind(
&ServicesCustomizationDocument::OnCheckedWallpaperCacheExists, &ServicesCustomizationDocument::OnCheckedWallpaperCacheExists,
weak_ptr_factory_.GetWeakPtr(), base::Passed(std::move(exists)), weak_ptr_factory_.GetWeakPtr(), base::Passed(std::move(exists)),
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#include "base/memory/singleton.h" #include "base/memory/singleton.h"
#include "base/memory/weak_ptr.h" #include "base/memory/weak_ptr.h"
#include "base/values.h" #include "base/values.h"
#include "net/url_request/url_fetcher_delegate.h"
#include "url/gurl.h" #include "url/gurl.h"
class PrefRegistrySimple; class PrefRegistrySimple;
...@@ -31,14 +32,8 @@ namespace extensions { ...@@ -31,14 +32,8 @@ namespace extensions {
class ExternalLoader; class ExternalLoader;
} }
namespace network { namespace net {
class SimpleURLLoader; class URLFetcher;
}
namespace network {
namespace mojom {
class URLLoaderFactory;
}
} }
namespace user_prefs { namespace user_prefs {
...@@ -146,7 +141,8 @@ class StartupCustomizationDocument : public CustomizationDocument { ...@@ -146,7 +141,8 @@ class StartupCustomizationDocument : public CustomizationDocument {
// outside this class by calling StartFetching() or EnsureCustomizationApplied() // outside this class by calling StartFetching() or EnsureCustomizationApplied()
// methods. // methods.
// User of the file should check IsReady before use it. // User of the file should check IsReady before use it.
class ServicesCustomizationDocument : public CustomizationDocument { class ServicesCustomizationDocument : public CustomizationDocument,
private net::URLFetcherDelegate {
public: public:
static ServicesCustomizationDocument* GetInstance(); static ServicesCustomizationDocument* GetInstance();
...@@ -204,11 +200,6 @@ class ServicesCustomizationDocument : public CustomizationDocument { ...@@ -204,11 +200,6 @@ class ServicesCustomizationDocument : public CustomizationDocument {
return wallpaper_downloader_.get(); return wallpaper_downloader_.get();
} }
void SetURLLoaderFactoryForTesting(
network::mojom::URLLoaderFactory* url_loader_factory) {
url_loader_factory_ = url_loader_factory;
}
private: private:
friend struct base::DefaultSingletonTraits<ServicesCustomizationDocument>; friend struct base::DefaultSingletonTraits<ServicesCustomizationDocument>;
FRIEND_TEST_ALL_PREFIXES(CustomizationWallpaperDownloaderBrowserTest, FRIEND_TEST_ALL_PREFIXES(CustomizationWallpaperDownloaderBrowserTest,
...@@ -236,7 +227,8 @@ class ServicesCustomizationDocument : public CustomizationDocument { ...@@ -236,7 +227,8 @@ class ServicesCustomizationDocument : public CustomizationDocument {
// Overriden from CustomizationDocument: // Overriden from CustomizationDocument:
bool LoadManifestFromString(const std::string& manifest) override; bool LoadManifestFromString(const std::string& manifest) override;
void OnSimpleLoaderComplete(std::unique_ptr<std::string> response_body); // Overriden from net::URLFetcherDelegate:
void OnURLFetchComplete(const net::URLFetcher* source) override;
// Initiate file fetching. Wait for online status. // Initiate file fetching. Wait for online status.
void StartFileFetch(); void StartFileFetch();
...@@ -301,6 +293,9 @@ class ServicesCustomizationDocument : public CustomizationDocument { ...@@ -301,6 +293,9 @@ class ServicesCustomizationDocument : public CustomizationDocument {
// Services customization manifest URL. // Services customization manifest URL.
GURL url_; GURL url_;
// URLFetcher instance.
std::unique_ptr<net::URLFetcher> url_fetcher_;
// How many times we already tried to fetch customization manifest file. // How many times we already tried to fetch customization manifest file.
int num_retries_; int num_retries_;
...@@ -314,7 +309,6 @@ class ServicesCustomizationDocument : public CustomizationDocument { ...@@ -314,7 +309,6 @@ class ServicesCustomizationDocument : public CustomizationDocument {
ExternalLoaders external_loaders_; ExternalLoaders external_loaders_;
std::unique_ptr<CustomizationWallpaperDownloader> wallpaper_downloader_; std::unique_ptr<CustomizationWallpaperDownloader> wallpaper_downloader_;
std::unique_ptr<network::SimpleURLLoader> simple_loader_;
// This is barrier until customization is applied. // This is barrier until customization is applied.
// When number of finished tasks match number of started - customization is // When number of finished tasks match number of started - customization is
...@@ -327,9 +321,6 @@ class ServicesCustomizationDocument : public CustomizationDocument { ...@@ -327,9 +321,6 @@ class ServicesCustomizationDocument : public CustomizationDocument {
// successfully. // successfully.
size_t apply_tasks_success_; size_t apply_tasks_success_;
// Only used for unit tests. Not owned.
network::mojom::URLLoaderFactory* url_loader_factory_;
// Weak factory for callbacks. // Weak factory for callbacks.
base::WeakPtrFactory<ServicesCustomizationDocument> weak_ptr_factory_; base::WeakPtrFactory<ServicesCustomizationDocument> weak_ptr_factory_;
......
...@@ -33,11 +33,13 @@ ...@@ -33,11 +33,13 @@
#include "extensions/common/manifest.h" #include "extensions/common/manifest.h"
#include "net/http/http_response_headers.h" #include "net/http/http_response_headers.h"
#include "net/http/http_status_code.h" #include "net/http/http_status_code.h"
#include "net/http/http_util.h" #include "net/url_request/test_url_fetcher_factory.h"
#include "services/network/test/test_url_loader_factory.h" #include "net/url_request/url_request_status.h"
#include "testing/gmock/include/gmock/gmock.h" #include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
using ::testing::Exactly;
using ::testing::Invoke;
using ::testing::Mock; using ::testing::Mock;
using ::testing::_; using ::testing::_;
using extensions::ExternalInstallInfoFile; using extensions::ExternalInstallInfoFile;
...@@ -158,6 +160,30 @@ TEST(StartupCustomizationDocumentTest, BadManifest) { ...@@ -158,6 +160,30 @@ TEST(StartupCustomizationDocumentTest, BadManifest) {
EXPECT_FALSE(customization.IsReady()); EXPECT_FALSE(customization.IsReady());
} }
class TestURLFetcherCallback {
public:
std::unique_ptr<net::FakeURLFetcher> CreateURLFetcher(
const GURL& url,
net::URLFetcherDelegate* d,
const std::string& response_data,
net::HttpStatusCode response_code,
net::URLRequestStatus::Status status) {
std::unique_ptr<net::FakeURLFetcher> fetcher(
new net::FakeURLFetcher(url, d, response_data, response_code, status));
OnRequestCreate(url, fetcher.get());
return fetcher;
}
MOCK_METHOD2(OnRequestCreate,
void(const GURL&, net::FakeURLFetcher*));
};
void AddMimeHeader(const GURL& url, net::FakeURLFetcher* fetcher) {
scoped_refptr<net::HttpResponseHeaders> download_headers =
new net::HttpResponseHeaders("");
download_headers->AddHeader("Content-Type: application/json");
fetcher->set_response_headers(download_headers);
}
class MockExternalProviderVisitor class MockExternalProviderVisitor
: public extensions::ExternalProviderInterface::VisitorInterface { : public extensions::ExternalProviderInterface::VisitorInterface {
public: public:
...@@ -178,6 +204,11 @@ class MockExternalProviderVisitor ...@@ -178,6 +204,11 @@ class MockExternalProviderVisitor
class ServicesCustomizationDocumentTest : public testing::Test { class ServicesCustomizationDocumentTest : public testing::Test {
protected: protected:
ServicesCustomizationDocumentTest()
: factory_(nullptr,
base::Bind(&TestURLFetcherCallback::CreateURLFetcher,
base::Unretained(&url_callback_))) {}
// testing::Test: // testing::Test:
void SetUp() override { void SetUp() override {
ServicesCustomizationDocument::InitializeForTesting(); ServicesCustomizationDocument::InitializeForTesting();
...@@ -228,33 +259,25 @@ class ServicesCustomizationDocumentTest : public testing::Test { ...@@ -228,33 +259,25 @@ class ServicesCustomizationDocumentTest : public testing::Test {
const std::string& manifest) { const std::string& manifest) {
GURL url(base::StringPrintf(ServicesCustomizationDocument::kManifestUrl, GURL url(base::StringPrintf(ServicesCustomizationDocument::kManifestUrl,
id.c_str())); id.c_str()));
network::ResourceResponseHead head; factory_.SetFakeResponse(url,
char base_headers_string[] = manifest,
"HTTP/1.0 200 OK\r\n" net::HTTP_OK,
"\r\n"; net::URLRequestStatus::SUCCESS);
head.headers = base::MakeRefCounted<net::HttpResponseHeaders>( EXPECT_CALL(url_callback_, OnRequestCreate(url, _))
net::HttpUtil::AssembleRawHeaders(base_headers_string, .Times(Exactly(1))
sizeof(base_headers_string))); .WillRepeatedly(Invoke(AddMimeHeader));
head.headers->AddHeader("Content-Type: application/json");
network::URLLoaderCompletionStatus status;
status.decoded_body_length = manifest.size();
factory_.AddResponse(url, head, manifest, status);
} }
void AddManifestNotFound(const std::string& id) { void AddManifestNotFound(const std::string& id) {
GURL url(base::StringPrintf(ServicesCustomizationDocument::kManifestUrl, GURL url(base::StringPrintf(ServicesCustomizationDocument::kManifestUrl,
id.c_str())); id.c_str()));
network::ResourceResponseHead head; factory_.SetFakeResponse(url,
char base_headers_string[] = std::string(),
"HTTP/1.x 404 Not Found\r\n" net::HTTP_NOT_FOUND,
"\r\n"; net::URLRequestStatus::SUCCESS);
head.headers = base::MakeRefCounted<net::HttpResponseHeaders>( EXPECT_CALL(url_callback_, OnRequestCreate(url, _))
net::HttpUtil::AssembleRawHeaders(base_headers_string, .Times(Exactly(1))
sizeof(base_headers_string))); .WillRepeatedly(Invoke(AddMimeHeader));
head.headers->AddHeader("Content-Type: application/json");
network::URLLoaderCompletionStatus status;
status.decoded_body_length = 0;
factory_.AddResponse(url, head, "", status);
} }
std::unique_ptr<TestingProfile> CreateProfile() { std::unique_ptr<TestingProfile> CreateProfile() {
...@@ -273,13 +296,13 @@ class ServicesCustomizationDocumentTest : public testing::Test { ...@@ -273,13 +296,13 @@ class ServicesCustomizationDocumentTest : public testing::Test {
return profile; return profile;
} }
network::TestURLLoaderFactory factory_;
private: private:
content::TestBrowserThreadBundle thread_bundle_; content::TestBrowserThreadBundle thread_bundle_;
system::ScopedFakeStatisticsProvider fake_statistics_provider_; system::ScopedFakeStatisticsProvider fake_statistics_provider_;
ScopedCrosSettingsTestHelper scoped_cros_settings_test_helper_; ScopedCrosSettingsTestHelper scoped_cros_settings_test_helper_;
TestingPrefServiceSimple local_state_; TestingPrefServiceSimple local_state_;
TestURLFetcherCallback url_callback_;
net::FakeURLFetcherFactory factory_;
NetworkPortalDetectorTestImpl network_portal_detector_; NetworkPortalDetectorTestImpl network_portal_detector_;
}; };
...@@ -291,7 +314,6 @@ TEST_F(ServicesCustomizationDocumentTest, Basic) { ...@@ -291,7 +314,6 @@ TEST_F(ServicesCustomizationDocumentTest, Basic) {
ServicesCustomizationDocument::GetInstance(); ServicesCustomizationDocument::GetInstance();
EXPECT_FALSE(doc->IsReady()); EXPECT_FALSE(doc->IsReady());
doc->SetURLLoaderFactoryForTesting(&factory_);
doc->StartFetching(); doc->StartFetching();
RunUntilIdle(); RunUntilIdle();
EXPECT_TRUE(doc->IsReady()); EXPECT_TRUE(doc->IsReady());
...@@ -329,7 +351,6 @@ TEST_F(ServicesCustomizationDocumentTest, NoCustomizationIdInVpd) { ...@@ -329,7 +351,6 @@ TEST_F(ServicesCustomizationDocumentTest, NoCustomizationIdInVpd) {
ServicesCustomizationDocument::GetInstance(); ServicesCustomizationDocument::GetInstance();
EXPECT_FALSE(doc->IsReady()); EXPECT_FALSE(doc->IsReady());
doc->SetURLLoaderFactoryForTesting(&factory_);
std::unique_ptr<TestingProfile> profile = CreateProfile(); std::unique_ptr<TestingProfile> profile = CreateProfile();
extensions::ExternalLoader* loader = doc->CreateExternalLoader(profile.get()); extensions::ExternalLoader* loader = doc->CreateExternalLoader(profile.get());
EXPECT_TRUE(loader); EXPECT_TRUE(loader);
...@@ -366,7 +387,6 @@ TEST_F(ServicesCustomizationDocumentTest, DefaultApps) { ...@@ -366,7 +387,6 @@ TEST_F(ServicesCustomizationDocumentTest, DefaultApps) {
ServicesCustomizationDocument::GetInstance(); ServicesCustomizationDocument::GetInstance();
EXPECT_FALSE(doc->IsReady()); EXPECT_FALSE(doc->IsReady());
doc->SetURLLoaderFactoryForTesting(&factory_);
std::unique_ptr<TestingProfile> profile = CreateProfile(); std::unique_ptr<TestingProfile> profile = CreateProfile();
extensions::ExternalLoader* loader = doc->CreateExternalLoader(profile.get()); extensions::ExternalLoader* loader = doc->CreateExternalLoader(profile.get());
EXPECT_TRUE(loader); EXPECT_TRUE(loader);
...@@ -417,7 +437,6 @@ TEST_F(ServicesCustomizationDocumentTest, CustomizationManifestNotFound) { ...@@ -417,7 +437,6 @@ TEST_F(ServicesCustomizationDocumentTest, CustomizationManifestNotFound) {
ServicesCustomizationDocument::GetInstance(); ServicesCustomizationDocument::GetInstance();
EXPECT_FALSE(doc->IsReady()); EXPECT_FALSE(doc->IsReady());
doc->SetURLLoaderFactoryForTesting(&factory_);
std::unique_ptr<TestingProfile> profile = CreateProfile(); std::unique_ptr<TestingProfile> profile = CreateProfile();
extensions::ExternalLoader* loader = doc->CreateExternalLoader(profile.get()); extensions::ExternalLoader* loader = doc->CreateExternalLoader(profile.get());
EXPECT_TRUE(loader); EXPECT_TRUE(loader);
......
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