| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/browser/cache_storage/cache_storage_cache.h" | 5 #include "content/browser/cache_storage/cache_storage_cache.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 420 GURL("http://example.com/no_body.html"), 200, "OK", | 420 GURL("http://example.com/no_body.html"), 200, "OK", |
| 421 blink::WebServiceWorkerResponseTypeDefault, headers, "", 0, GURL(), | 421 blink::WebServiceWorkerResponseTypeDefault, headers, "", 0, GURL(), |
| 422 blink::WebServiceWorkerResponseErrorUnknown, base::Time::Now(), | 422 blink::WebServiceWorkerResponseErrorUnknown, base::Time::Now(), |
| 423 false /* is_in_cache_storage */, | 423 false /* is_in_cache_storage */, |
| 424 std::string() /* cache_storage_cache_name */, | 424 std::string() /* cache_storage_cache_name */, |
| 425 ServiceWorkerHeaderList() /* cors_exposed_header_names */); | 425 ServiceWorkerHeaderList() /* cors_exposed_header_names */); |
| 426 } | 426 } |
| 427 | 427 |
| 428 std::unique_ptr<ServiceWorkerFetchRequest> CopyFetchRequest( | 428 std::unique_ptr<ServiceWorkerFetchRequest> CopyFetchRequest( |
| 429 const ServiceWorkerFetchRequest& request) { | 429 const ServiceWorkerFetchRequest& request) { |
| 430 return base::WrapUnique(new ServiceWorkerFetchRequest( | 430 return base::MakeUnique<ServiceWorkerFetchRequest>( |
| 431 request.url, request.method, request.headers, request.referrer, | 431 request.url, request.method, request.headers, request.referrer, |
| 432 request.is_reload)); | 432 request.is_reload); |
| 433 } | 433 } |
| 434 | 434 |
| 435 CacheStorageError BatchOperation( | 435 CacheStorageError BatchOperation( |
| 436 const std::vector<CacheStorageBatchOperation>& operations) { | 436 const std::vector<CacheStorageBatchOperation>& operations) { |
| 437 std::unique_ptr<base::RunLoop> loop(new base::RunLoop()); | 437 std::unique_ptr<base::RunLoop> loop(new base::RunLoop()); |
| 438 | 438 |
| 439 cache_->BatchOperation( | 439 cache_->BatchOperation( |
| 440 operations, | 440 operations, |
| 441 base::Bind(&CacheStorageCacheTest::ErrorTypeCallback, | 441 base::Bind(&CacheStorageCacheTest::ErrorTypeCallback, |
| 442 base::Unretained(this), base::Unretained(loop.get()))); | 442 base::Unretained(this), base::Unretained(loop.get()))); |
| (...skipping 1150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1593 EXPECT_EQ(1, sequence_out); | 1593 EXPECT_EQ(1, sequence_out); |
| 1594 close_loop2->Run(); | 1594 close_loop2->Run(); |
| 1595 EXPECT_EQ(2, sequence_out); | 1595 EXPECT_EQ(2, sequence_out); |
| 1596 } | 1596 } |
| 1597 | 1597 |
| 1598 INSTANTIATE_TEST_CASE_P(CacheStorageCacheTest, | 1598 INSTANTIATE_TEST_CASE_P(CacheStorageCacheTest, |
| 1599 CacheStorageCacheTestP, | 1599 CacheStorageCacheTestP, |
| 1600 ::testing::Values(false, true)); | 1600 ::testing::Values(false, true)); |
| 1601 | 1601 |
| 1602 } // namespace content | 1602 } // namespace content |
| OLD | NEW |