| 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/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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 false)); | 92 false)); |
| 93 | 93 |
| 94 std::string expected_response; | 94 std::string expected_response; |
| 95 for (int i = 0; i < 100; ++i) | 95 for (int i = 0; i < 100; ++i) |
| 96 expected_blob_data_ += kTestData; | 96 expected_blob_data_ += kTestData; |
| 97 | 97 |
| 98 scoped_refptr<storage::BlobData> blob_data( | 98 scoped_refptr<storage::BlobData> blob_data( |
| 99 new storage::BlobData("blob-id:myblob")); | 99 new storage::BlobData("blob-id:myblob")); |
| 100 blob_data->AppendData(expected_blob_data_); | 100 blob_data->AppendData(expected_blob_data_); |
| 101 | 101 |
| 102 blob_handle_ = blob_storage_context->context()->AddFinishedBlob(blob_data); | 102 blob_handle_ = |
| 103 blob_storage_context->context()->AddFinishedBlob(blob_data.get()); |
| 103 | 104 |
| 104 body_response_.reset( | 105 body_response_.reset( |
| 105 new ServiceWorkerResponse(GURL("http://example.com/body.html"), | 106 new ServiceWorkerResponse(GURL("http://example.com/body.html"), |
| 106 200, | 107 200, |
| 107 "OK", | 108 "OK", |
| 108 headers, | 109 headers, |
| 109 blob_handle_->uuid())); | 110 blob_handle_->uuid())); |
| 110 | 111 |
| 111 no_body_response_.reset(new ServiceWorkerResponse( | 112 no_body_response_.reset(new ServiceWorkerResponse( |
| 112 GURL("http://example.com/no_body.html"), 200, "OK", headers, "")); | 113 GURL("http://example.com/no_body.html"), 200, "OK", headers, "")); |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 301 ASSERT_TRUE(Match(body_request_.get())); | 302 ASSERT_TRUE(Match(body_request_.get())); |
| 302 ASSERT_TRUE(Delete(body_request_.get())); | 303 ASSERT_TRUE(Delete(body_request_.get())); |
| 303 } | 304 } |
| 304 } | 305 } |
| 305 | 306 |
| 306 INSTANTIATE_TEST_CASE_P(ServiceWorkerCacheTest, | 307 INSTANTIATE_TEST_CASE_P(ServiceWorkerCacheTest, |
| 307 ServiceWorkerCacheTestP, | 308 ServiceWorkerCacheTestP, |
| 308 ::testing::Values(false, true)); | 309 ::testing::Values(false, true)); |
| 309 | 310 |
| 310 } // namespace content | 311 } // namespace content |
| OLD | NEW |