Commit 53a38d00 authored by Victor Costan's avatar Victor Costan Committed by Commit Bot

Cache Storage: clang-tidy fixes in cache_storage_cache_unittest.cc

Change-Id: If6540fc63a02a012dc903beed9644e3eac478a74
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2495783
Commit-Queue: Victor Costan <pwnall@chromium.org>
Commit-Queue: Ben Kelly <wanderview@chromium.org>
Auto-Submit: Victor Costan <pwnall@chromium.org>
Reviewed-by: default avatarBen Kelly <wanderview@chromium.org>
Cr-Commit-Position: refs/heads/master@{#820434}
parent b3474bd3
...@@ -887,8 +887,8 @@ class CacheStorageCacheTest : public testing::Test { ...@@ -887,8 +887,8 @@ class CacheStorageCacheTest : public testing::Test {
callback_error_ = error; callback_error_ = error;
callback_strings_.clear(); callback_strings_.clear();
if (requests) { if (requests) {
for (size_t i = 0u; i < requests->size(); ++i) for (const blink::mojom::FetchAPIRequestPtr& request : *requests)
callback_strings_.push_back(requests->at(i)->url.spec()); callback_strings_.push_back(request->url.spec());
} }
if (run_loop) if (run_loop)
run_loop->Quit(); run_loop->Quit();
...@@ -1042,7 +1042,7 @@ TEST_P(CacheStorageCacheTestP, PutBody_Multiple) { ...@@ -1042,7 +1042,7 @@ TEST_P(CacheStorageCacheTestP, PutBody_Multiple) {
BackgroundFetchSettledFetch::CloneRequest(body_request_); BackgroundFetchSettledFetch::CloneRequest(body_request_);
operation1->request->url = GURL("http://example.com/1"); operation1->request->url = GURL("http://example.com/1");
operation1->response = CreateBlobBodyResponse(); operation1->response = CreateBlobBodyResponse();
operation1->response->url_list.push_back(GURL("http://example.com/1")); operation1->response->url_list.emplace_back("http://example.com/1");
blink::mojom::FetchAPIRequestPtr request1 = blink::mojom::FetchAPIRequestPtr request1 =
BackgroundFetchSettledFetch::CloneRequest(operation1->request); BackgroundFetchSettledFetch::CloneRequest(operation1->request);
...@@ -1053,7 +1053,7 @@ TEST_P(CacheStorageCacheTestP, PutBody_Multiple) { ...@@ -1053,7 +1053,7 @@ TEST_P(CacheStorageCacheTestP, PutBody_Multiple) {
BackgroundFetchSettledFetch::CloneRequest(body_request_); BackgroundFetchSettledFetch::CloneRequest(body_request_);
operation2->request->url = GURL("http://example.com/2"); operation2->request->url = GURL("http://example.com/2");
operation2->response = CreateBlobBodyResponse(); operation2->response = CreateBlobBodyResponse();
operation2->response->url_list.push_back(GURL("http://example.com/2")); operation2->response->url_list.emplace_back("http://example.com/2");
blink::mojom::FetchAPIRequestPtr request2 = blink::mojom::FetchAPIRequestPtr request2 =
BackgroundFetchSettledFetch::CloneRequest(operation2->request); BackgroundFetchSettledFetch::CloneRequest(operation2->request);
...@@ -1064,7 +1064,7 @@ TEST_P(CacheStorageCacheTestP, PutBody_Multiple) { ...@@ -1064,7 +1064,7 @@ TEST_P(CacheStorageCacheTestP, PutBody_Multiple) {
BackgroundFetchSettledFetch::CloneRequest(body_request_); BackgroundFetchSettledFetch::CloneRequest(body_request_);
operation3->request->url = GURL("http://example.com/3"); operation3->request->url = GURL("http://example.com/3");
operation3->response = CreateBlobBodyResponse(); operation3->response = CreateBlobBodyResponse();
operation3->response->url_list.push_back(GURL("http://example.com/3")); operation3->response->url_list.emplace_back("http://example.com/3");
blink::mojom::FetchAPIRequestPtr request3 = blink::mojom::FetchAPIRequestPtr request3 =
BackgroundFetchSettledFetch::CloneRequest(operation3->request); BackgroundFetchSettledFetch::CloneRequest(operation3->request);
...@@ -1154,7 +1154,7 @@ TEST_P(CacheStorageCacheTestP, KeysLimit) { ...@@ -1154,7 +1154,7 @@ TEST_P(CacheStorageCacheTestP, KeysLimit) {
TEST_P(CacheStorageCacheTestP, ResponseURLDiffersFromRequestURL) { TEST_P(CacheStorageCacheTestP, ResponseURLDiffersFromRequestURL) {
blink::mojom::FetchAPIResponsePtr no_body_response = CreateNoBodyResponse(); blink::mojom::FetchAPIResponsePtr no_body_response = CreateNoBodyResponse();
no_body_response->url_list.clear(); no_body_response->url_list.clear();
no_body_response->url_list.push_back(GURL("http://example.com/foobar")); no_body_response->url_list.emplace_back("http://example.com/foobar");
EXPECT_STRNE("http://example.com/foobar", EXPECT_STRNE("http://example.com/foobar",
no_body_request_->url.spec().c_str()); no_body_request_->url.spec().c_str());
EXPECT_TRUE(Put(no_body_request_, std::move(no_body_response))); EXPECT_TRUE(Put(no_body_request_, std::move(no_body_response)));
...@@ -2167,7 +2167,7 @@ TEST_P(CacheStorageCacheTestP, PutResponseUrlListObeysQuotaLimits) { ...@@ -2167,7 +2167,7 @@ TEST_P(CacheStorageCacheTestP, PutResponseUrlListObeysQuotaLimits) {
cache_->GetRequiredSafeSpaceForResponse(response); cache_->GetRequiredSafeSpaceForResponse(response);
SetQuota(safe_expected_entry_size.ValueOrDie()); SetQuota(safe_expected_entry_size.ValueOrDie());
response->url_list.push_back(GURL("http://example.com/another-url")); response->url_list.emplace_back("http://example.com/another-url");
EXPECT_FALSE(Put(body_request_, std::move(response))); EXPECT_FALSE(Put(body_request_, std::move(response)));
EXPECT_EQ(CacheStorageError::kErrorQuotaExceeded, callback_error_); EXPECT_EQ(CacheStorageError::kErrorQuotaExceeded, callback_error_);
} }
...@@ -2638,7 +2638,7 @@ TEST_P(CacheStorageCacheTestP, SelfRefsDuringBatchOperation) { ...@@ -2638,7 +2638,7 @@ TEST_P(CacheStorageCacheTestP, SelfRefsDuringBatchOperation) {
operation->request = BackgroundFetchSettledFetch::CloneRequest(body_request_); operation->request = BackgroundFetchSettledFetch::CloneRequest(body_request_);
operation->request->url = GURL("http://example.com/1"); operation->request->url = GURL("http://example.com/1");
operation->response = CreateBlobBodyResponse(); operation->response = CreateBlobBodyResponse();
operation->response->url_list.push_back(GURL("http://example.com/1")); operation->response->url_list.emplace_back("http://example.com/1");
std::vector<blink::mojom::BatchOperationPtr> operations; std::vector<blink::mojom::BatchOperationPtr> operations;
operations.push_back(std::move(operation)); operations.push_back(std::move(operation));
......
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