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

Side by Side Diff: content/browser/service_worker/service_worker_cache_unittest.cc

Issue 895933007: [Storage] Blob items are now shared between blobs. Ready for disk swap. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cleanup and added one more histogram Created 5 years, 10 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/service_worker/service_worker_cache.h" 5 #include "content/browser/service_worker/service_worker_cache.h"
6 6
7 #include "base/files/file_path.h" 7 #include "base/files/file_path.h"
8 #include "base/files/scoped_temp_dir.h" 8 #include "base/files/scoped_temp_dir.h"
9 #include "base/message_loop/message_loop_proxy.h" 9 #include "base/message_loop/message_loop_proxy.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 228
229 std::string expected_response; 229 std::string expected_response;
230 for (int i = 0; i < 100; ++i) 230 for (int i = 0; i < 100; ++i)
231 expected_blob_data_ += kTestData; 231 expected_blob_data_ += kTestData;
232 232
233 scoped_ptr<storage::BlobDataBuilder> blob_data( 233 scoped_ptr<storage::BlobDataBuilder> blob_data(
234 new storage::BlobDataBuilder("blob-id:myblob")); 234 new storage::BlobDataBuilder("blob-id:myblob"));
235 blob_data->AppendData(expected_blob_data_); 235 blob_data->AppendData(expected_blob_data_);
236 236
237 blob_handle_ = 237 blob_handle_ =
238 blob_storage_context->context()->AddFinishedBlob(*blob_data.get()); 238 blob_storage_context->context()->AddFinishedBlob(blob_data.get());
239 239
240 body_response_ = 240 body_response_ =
241 ServiceWorkerResponse(GURL("http://example.com/body.html"), 241 ServiceWorkerResponse(GURL("http://example.com/body.html"),
242 200, 242 200,
243 "OK", 243 "OK",
244 blink::WebServiceWorkerResponseTypeDefault, 244 blink::WebServiceWorkerResponseTypeDefault,
245 headers, 245 headers,
246 blob_handle_->uuid(), 246 blob_handle_->uuid(),
247 expected_blob_data_.size(), 247 expected_blob_data_.size(),
248 GURL()); 248 GURL());
(...skipping 578 matching lines...) Expand 10 before | Expand all | Expand 10 after
827 EXPECT_EQ(1, callback_response_->status_code); 827 EXPECT_EQ(1, callback_response_->status_code);
828 close_loop2->Run(); 828 close_loop2->Run();
829 EXPECT_EQ(2, callback_response_->status_code); 829 EXPECT_EQ(2, callback_response_->status_code);
830 } 830 }
831 831
832 INSTANTIATE_TEST_CASE_P(ServiceWorkerCacheTest, 832 INSTANTIATE_TEST_CASE_P(ServiceWorkerCacheTest,
833 ServiceWorkerCacheTestP, 833 ServiceWorkerCacheTestP,
834 ::testing::Values(false, true)); 834 ::testing::Values(false, true));
835 835
836 } // namespace content 836 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698