| 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 <stdint.h> | 5 #include <stdint.h> |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 const int kMockBodySize = 5; | 36 const int kMockBodySize = 5; |
| 37 | 37 |
| 38 class MockResponseReader : public AppCacheResponseReader { | 38 class MockResponseReader : public AppCacheResponseReader { |
| 39 public: | 39 public: |
| 40 MockResponseReader(int64_t response_id, | 40 MockResponseReader(int64_t response_id, |
| 41 net::HttpResponseInfo* info, | 41 net::HttpResponseInfo* info, |
| 42 int info_size, | 42 int info_size, |
| 43 const char* data, | 43 const char* data, |
| 44 int data_size) | 44 int data_size) |
| 45 : AppCacheResponseReader(response_id, | 45 : AppCacheResponseReader(response_id, |
| 46 0, | |
| 47 base::WeakPtr<AppCacheDiskCacheInterface>()), | 46 base::WeakPtr<AppCacheDiskCacheInterface>()), |
| 48 info_(info), | 47 info_(info), |
| 49 info_size_(info_size), | 48 info_size_(info_size), |
| 50 data_(data), | 49 data_(data), |
| 51 data_size_(data_size) {} | 50 data_size_(data_size) {} |
| 52 void ReadInfo(HttpResponseInfoIOBuffer* info_buf, | 51 void ReadInfo(HttpResponseInfoIOBuffer* info_buf, |
| 53 const net::CompletionCallback& callback) override { | 52 const net::CompletionCallback& callback) override { |
| 54 info_buffer_ = info_buf; | 53 info_buffer_ = info_buf; |
| 55 callback_ = callback; // Cleared on completion. | 54 callback_ = callback; // Cleared on completion. |
| 56 | 55 |
| (...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 380 EXPECT_EQ(kOneHour, service->reinit_timer_.GetCurrentDelay()); | 379 EXPECT_EQ(kOneHour, service->reinit_timer_.GetCurrentDelay()); |
| 381 EXPECT_EQ(kOneHour, service->next_reinit_delay_); | 380 EXPECT_EQ(kOneHour, service->next_reinit_delay_); |
| 382 | 381 |
| 383 // Fine to delete while pending. | 382 // Fine to delete while pending. |
| 384 service.reset(NULL); | 383 service.reset(NULL); |
| 385 } | 384 } |
| 386 | 385 |
| 387 | 386 |
| 388 | 387 |
| 389 } // namespace content | 388 } // namespace content |
| OLD | NEW |