Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(750)

Side by Side Diff: content/browser/cache_storage/cache_storage_cache_unittest.cc

Issue 1578363009: CacheStorage: Add ignoreSearch option to cache.matchAll(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed comments Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698