Chromium Code Reviews| 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 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 377 base::Bind(&CacheStorageCacheTest::ResponseAndErrorCallback, | 377 base::Bind(&CacheStorageCacheTest::ResponseAndErrorCallback, |
| 378 base::Unretained(this), base::Unretained(loop.get()))); | 378 base::Unretained(this), base::Unretained(loop.get()))); |
| 379 loop->Run(); | 379 loop->Run(); |
| 380 | 380 |
| 381 return callback_error_ == CACHE_STORAGE_OK; | 381 return callback_error_ == CACHE_STORAGE_OK; |
| 382 } | 382 } |
| 383 | 383 |
| 384 bool MatchAll(scoped_ptr<CacheStorageCache::Responses>* responses, | 384 bool MatchAll(scoped_ptr<CacheStorageCache::Responses>* responses, |
| 385 scoped_ptr<CacheStorageCache::BlobDataHandles>* body_handles) { | 385 scoped_ptr<CacheStorageCache::BlobDataHandles>* body_handles) { |
| 386 base::RunLoop loop; | 386 base::RunLoop loop; |
| 387 cache_->MatchAll(base::Bind( | 387 cache_->MatchAll( |
| 388 &CacheStorageCacheTest::ResponsesAndErrorCallback, | 388 scoped_ptr<ServiceWorkerFetchRequest>(), CacheStorageCacheQueryParams(), |
|
nhiroki
2016/02/10 07:35:32
Can you add unittests for the case where 'ignore_s
zino
2016/02/11 03:35:05
Done.
| |
| 389 base::Unretained(this), loop.QuitClosure(), responses, body_handles)); | 389 base::Bind(&CacheStorageCacheTest::ResponsesAndErrorCallback, |
| 390 base::Unretained(this), loop.QuitClosure(), responses, | |
| 391 body_handles)); | |
| 390 loop.Run(); | 392 loop.Run(); |
| 391 return callback_error_ == CACHE_STORAGE_OK; | 393 return callback_error_ == CACHE_STORAGE_OK; |
| 392 } | 394 } |
| 393 | 395 |
| 394 bool Delete(const ServiceWorkerFetchRequest& request) { | 396 bool Delete(const ServiceWorkerFetchRequest& request) { |
| 395 CacheStorageBatchOperation operation; | 397 CacheStorageBatchOperation operation; |
| 396 operation.operation_type = CACHE_STORAGE_CACHE_OPERATION_TYPE_DELETE; | 398 operation.operation_type = CACHE_STORAGE_CACHE_OPERATION_TYPE_DELETE; |
| 397 operation.request = request; | 399 operation.request = request; |
| 398 | 400 |
| 399 CacheStorageError error = | 401 CacheStorageError error = |
| (...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1034 EXPECT_EQ(1, sequence_out); | 1036 EXPECT_EQ(1, sequence_out); |
| 1035 close_loop2->Run(); | 1037 close_loop2->Run(); |
| 1036 EXPECT_EQ(2, sequence_out); | 1038 EXPECT_EQ(2, sequence_out); |
| 1037 } | 1039 } |
| 1038 | 1040 |
| 1039 INSTANTIATE_TEST_CASE_P(CacheStorageCacheTest, | 1041 INSTANTIATE_TEST_CASE_P(CacheStorageCacheTest, |
| 1040 CacheStorageCacheTestP, | 1042 CacheStorageCacheTestP, |
| 1041 ::testing::Values(false, true)); | 1043 ::testing::Values(false, true)); |
| 1042 | 1044 |
| 1043 } // namespace content | 1045 } // namespace content |
| OLD | NEW |