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 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
368 base::Bind(&CacheStorageCacheTest::ResponseAndErrorCallback, | 368 base::Bind(&CacheStorageCacheTest::ResponseAndErrorCallback, |
369 base::Unretained(this), base::Unretained(loop.get()))); | 369 base::Unretained(this), base::Unretained(loop.get()))); |
370 loop->Run(); | 370 loop->Run(); |
371 | 371 |
372 return callback_error_ == CACHE_STORAGE_OK; | 372 return callback_error_ == CACHE_STORAGE_OK; |
373 } | 373 } |
374 | 374 |
375 bool MatchAll(scoped_ptr<CacheStorageCache::Responses>* responses, | 375 bool MatchAll(scoped_ptr<CacheStorageCache::Responses>* responses, |
376 scoped_ptr<CacheStorageCache::BlobDataHandles>* body_handles) { | 376 scoped_ptr<CacheStorageCache::BlobDataHandles>* body_handles) { |
377 base::RunLoop loop; | 377 base::RunLoop loop; |
378 cache_->MatchAll(base::Bind( | 378 cache_->MatchAll( |
379 &CacheStorageCacheTest::ResponsesAndErrorCallback, | 379 scoped_ptr<ServiceWorkerFetchRequest>(), CacheStorageCacheQueryParams(), |
380 base::Unretained(this), loop.QuitClosure(), responses, body_handles)); | 380 base::Bind(&CacheStorageCacheTest::ResponsesAndErrorCallback, |
| 381 base::Unretained(this), loop.QuitClosure(), responses, |
| 382 body_handles)); |
381 loop.Run(); | 383 loop.Run(); |
382 return callback_error_ == CACHE_STORAGE_OK; | 384 return callback_error_ == CACHE_STORAGE_OK; |
383 } | 385 } |
384 | 386 |
385 bool Delete(const ServiceWorkerFetchRequest& request) { | 387 bool Delete(const ServiceWorkerFetchRequest& request) { |
386 CacheStorageBatchOperation operation; | 388 CacheStorageBatchOperation operation; |
387 operation.operation_type = CACHE_STORAGE_CACHE_OPERATION_TYPE_DELETE; | 389 operation.operation_type = CACHE_STORAGE_CACHE_OPERATION_TYPE_DELETE; |
388 operation.request = request; | 390 operation.request = request; |
389 | 391 |
390 CacheStorageError error = | 392 CacheStorageError error = |
(...skipping 625 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1016 EXPECT_EQ(1, sequence_out); | 1018 EXPECT_EQ(1, sequence_out); |
1017 close_loop2->Run(); | 1019 close_loop2->Run(); |
1018 EXPECT_EQ(2, sequence_out); | 1020 EXPECT_EQ(2, sequence_out); |
1019 } | 1021 } |
1020 | 1022 |
1021 INSTANTIATE_TEST_CASE_P(CacheStorageCacheTest, | 1023 INSTANTIATE_TEST_CASE_P(CacheStorageCacheTest, |
1022 CacheStorageCacheTestP, | 1024 CacheStorageCacheTestP, |
1023 ::testing::Values(false, true)); | 1025 ::testing::Values(false, true)); |
1024 | 1026 |
1025 } // namespace content | 1027 } // namespace content |
OLD | NEW |