Commit 8d5f7bba authored by Antonio Gomes's avatar Antonio Gomes Committed by Commit Bot

fixup! Migrate components/metrics/net to network::SimpleURLLoader

Follow up of [1], that introduces
TestURLLoaderFactory::GetPendingRequest.

[1] https://crrev.com/c/1234133

TBR=isherman@chromium.org

BUG=844938

Change-Id: I59b19774462957fa71e09759f0154471f2a6c8f3
Reviewed-on: https://chromium-review.googlesource.com/1234634Reviewed-by: default avatarAntonio Gomes <tonikitoo@igalia.com>
Commit-Queue: Antonio Gomes <tonikitoo@igalia.com>
Cr-Commit-Position: refs/heads/master@{#592491}
parent 032dacb3
......@@ -89,15 +89,6 @@ class NetMetricsLogUploaderTest : public testing::Test {
}
}
network::TestURLLoaderFactory::PendingRequest* GetPendingRequest(
size_t index) {
if (index >= test_url_loader_factory_.pending_requests()->size())
return nullptr;
auto* request = &(*test_url_loader_factory_.pending_requests())[index];
DCHECK(request);
return request;
}
int on_upload_complete_count() const {
return on_upload_complete_count_;
}
......@@ -148,13 +139,15 @@ TEST_F(NetMetricsLogUploaderTest, OnUploadCompleteReuseUploader) {
// Mimic the initial fetcher callback.
CheckReportingInfoHeader(last_request_headers(), 10);
auto* pending_request_0 = test_url_loader_factory()->GetPendingRequest(0);
test_url_loader_factory()->SimulateResponseWithoutRemovingFromPendingList(
GetPendingRequest(0), "");
pending_request_0, "");
// Mimic the second fetcher callback.
CheckReportingInfoHeader(last_request_headers(), 20);
auto* pending_request_1 = test_url_loader_factory()->GetPendingRequest(1);
test_url_loader_factory()->SimulateResponseWithoutRemovingFromPendingList(
GetPendingRequest(1), "");
pending_request_1, "");
EXPECT_EQ(on_upload_complete_count(), 2);
}
......
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