Commit edc06504 authored by Antonio Gomes's avatar Antonio Gomes Committed by Commit Bot

fixup! Reland "Migrate ContentHashFetcher to SimpleURLLoader"

Now that [1] is fixed, we do not need to install the URLInterceptor
as the first thing we do when bootstrap'ing ContentVerifierHashTest.

This CL is a follow up of [2]. It reverts some of the flow changed by
[2] now that we can.

[1] https://crrev.com/c/1117822 (Fix for URLLoaderInterceptor with StoragePartition).
[2] https://crrev.com/c/1076947 (Reland "Migrate ContentHashFetcher to SimpleURLLoader").

BUG=844926

Change-Id: I1f4b2651b3f14196c1523109e8ade5f9cdb3ecac
Reviewed-on: https://chromium-review.googlesource.com/1163862Reviewed-by: default avatarDevlin <rdevlin.cronin@chromium.org>
Commit-Queue: Antonio Gomes <tonikitoo@igalia.com>
Cr-Commit-Position: refs/heads/master@{#581095}
parent 083e6337
......@@ -320,11 +320,6 @@ class ContentVerifierHashTest
// Installs test extension that is copied from the webstore with actual
// signatures.
testing::AssertionResult InstallExtension(ExtensionType type) {
// Install the interceptor at the very beginning of the tests' execution
// flow, so that it catches all URLLoaderFactory creations.
if (!hash_fetching_disabled_ && !InstallInterceptor())
return testing::AssertionFailure() << "Failed to install interceptor.";
// This observer will make sure content hash read and computed_hashes.json
// writing is complete before we proceed.
VerifierObserver verifier_observer;
......@@ -348,8 +343,8 @@ class ContentVerifierHashTest
info_ = std::make_unique<ExtensionInfo>(extension, type);
// Set up the data needed by the interceptor functor.
if (!hash_fetching_disabled_ && !SetUpInterceptorData())
// Set up the interceptor functor and data needed by it.
if (!hash_fetching_disabled_ && !InstallInterceptor())
return testing::AssertionFailure() << "Failed to install interceptor.";
return testing::AssertionSuccess();
......@@ -361,6 +356,8 @@ class ContentVerifierHashTest
return false;
}
SetUpInterceptorData();
auto interceptor_function =
[](GURL* fetch_url, base::FilePath* file_path,
content::URLLoaderInterceptor::RequestParams* params) {
......
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