| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/child/test_request_peer.h" | 5 #include "content/child/test_request_peer.h" |
| 6 | 6 |
| 7 #include "content/child/resource_dispatcher.h" | 7 #include "content/child/resource_dispatcher.h" |
| 8 #include "net/url_request/redirect_info.h" | 8 #include "net/url_request/redirect_info.h" |
| 9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
| 10 | 10 |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 if (context_->cancelled) | 78 if (context_->cancelled) |
| 79 return; | 79 return; |
| 80 context_->cached_metadata = std::vector<char>(data, data + len); | 80 context_->cached_metadata = std::vector<char>(data, data + len); |
| 81 } | 81 } |
| 82 | 82 |
| 83 void TestRequestPeer::OnCompletedRequest(int error_code, | 83 void TestRequestPeer::OnCompletedRequest(int error_code, |
| 84 bool was_ignored_by_handler, | 84 bool was_ignored_by_handler, |
| 85 bool stale_copy_in_cache, | 85 bool stale_copy_in_cache, |
| 86 const base::TimeTicks& completion_time, | 86 const base::TimeTicks& completion_time, |
| 87 int64_t total_transfer_size, | 87 int64_t total_transfer_size, |
| 88 int64_t encoded_body_size) { | 88 int64_t encoded_body_size, |
| 89 int64_t decoded_body_size) { |
| 89 if (context_->cancelled) | 90 if (context_->cancelled) |
| 90 return; | 91 return; |
| 91 EXPECT_TRUE(context_->received_response); | 92 EXPECT_TRUE(context_->received_response); |
| 92 EXPECT_FALSE(context_->complete); | 93 EXPECT_FALSE(context_->complete); |
| 93 context_->complete = true; | 94 context_->complete = true; |
| 94 } | 95 } |
| 95 | 96 |
| 96 TestRequestPeer::Context::Context() = default; | 97 TestRequestPeer::Context::Context() = default; |
| 97 TestRequestPeer::Context::~Context() = default; | 98 TestRequestPeer::Context::~Context() = default; |
| 98 | 99 |
| 99 } // namespace content | 100 } // namespace content |
| OLD | NEW |