Commit e4576f83 authored by Dominic Farolino's avatar Dominic Farolino Committed by Commit Bot

Fix RawResource::MatchPreload and modify test

This CL fixes RawResource::MatchPreload. RawResource::MatchPreload
should invoke the base class's MatchPreload. It did this, but then
https://crrev.com/c/2154817 accidentally removed this invocation during
a clean-up. This CL adds the invocation back, and modifies a RawResource
preload test to depend on this fix.

R=yhirano@chromium.org,yoavweiss@chromium.org

Bug: N/A
Change-Id: Ie4166670a1251e5d0a19dfcfbe3611c6a8c5e1d4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2157305Reviewed-by: default avatarYoav Weiss <yoavweiss@chromium.org>
Commit-Queue: Dominic Farolino <dom@chromium.org>
Cr-Commit-Position: refs/heads/master@{#760597}
parent 667e85ff
...@@ -351,6 +351,7 @@ void RawResource::DidDownloadToBlob(scoped_refptr<BlobDataHandle> blob) { ...@@ -351,6 +351,7 @@ void RawResource::DidDownloadToBlob(scoped_refptr<BlobDataHandle> blob) {
} }
void RawResource::MatchPreload(const FetchParameters& params) { void RawResource::MatchPreload(const FetchParameters& params) {
Resource::MatchPreload(params);
matched_with_non_streaming_destination_ = matched_with_non_streaming_destination_ =
!params.GetResourceRequest().UseStreamOnResponse(); !params.GetResourceRequest().UseStreamOnResponse();
} }
......
...@@ -256,6 +256,7 @@ TEST_F(RawResourceTest, PreloadWithAsynchronousAddClient) { ...@@ -256,6 +256,7 @@ TEST_F(RawResourceTest, PreloadWithAsynchronousAddClient) {
FetchParameters params(std::move(request)); FetchParameters params(std::move(request));
params.MutableResourceRequest().SetUseStreamOnResponse(false); params.MutableResourceRequest().SetUseStreamOnResponse(false);
raw->MatchPreload(params); raw->MatchPreload(params);
EXPECT_FALSE(raw->IsUnusedPreload());
raw->AddClient(dummy_client, platform_->test_task_runner().get()); raw->AddClient(dummy_client, platform_->test_task_runner().get());
raw->ResponseBodyReceived(*body_loader, platform_->test_task_runner()); raw->ResponseBodyReceived(*body_loader, platform_->test_task_runner());
......
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