OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/resource_dispatcher.h" | 5 #include "content/child/resource_dispatcher.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
268 &duplicate_handle)); | 268 &duplicate_handle)); |
269 EXPECT_TRUE(dispatcher_->OnMessageReceived(ResourceMsg_SetDataBuffer( | 269 EXPECT_TRUE(dispatcher_->OnMessageReceived(ResourceMsg_SetDataBuffer( |
270 request_id, duplicate_handle, shared_memory->requested_size(), 0))); | 270 request_id, duplicate_handle, shared_memory->requested_size(), 0))); |
271 } | 271 } |
272 | 272 |
273 void NotifyDataReceived(int request_id, const std::string& data) { | 273 void NotifyDataReceived(int request_id, const std::string& data) { |
274 ASSERT_LE(data.length(), shared_memory_map_[request_id]->requested_size()); | 274 ASSERT_LE(data.length(), shared_memory_map_[request_id]->requested_size()); |
275 memcpy(shared_memory_map_[request_id]->memory(), data.c_str(), | 275 memcpy(shared_memory_map_[request_id]->memory(), data.c_str(), |
276 data.length()); | 276 data.length()); |
277 | 277 |
278 EXPECT_TRUE(dispatcher_->OnMessageReceived( | 278 EXPECT_TRUE(dispatcher_->OnMessageReceived(ResourceMsg_DataReceived( |
279 ResourceMsg_DataReceived(request_id, 0, data.length(), data.length()))); | 279 request_id, 0, data.length(), data.length(), data.length()))); |
Mike West
2016/06/24 10:49:20
It surprises me that this is the only test change.
Adam Rice
2016/07/07 06:50:09
AsyncResourceHandler had no tests. I have added so
| |
280 } | 280 } |
281 | 281 |
282 void NotifyDataDownloaded(int request_id, int decoded_length, | 282 void NotifyDataDownloaded(int request_id, int decoded_length, |
283 int encoded_length) { | 283 int encoded_length) { |
284 EXPECT_TRUE(dispatcher_->OnMessageReceived(ResourceMsg_DataDownloaded( | 284 EXPECT_TRUE(dispatcher_->OnMessageReceived(ResourceMsg_DataDownloaded( |
285 request_id, decoded_length, encoded_length))); | 285 request_id, decoded_length, encoded_length))); |
286 } | 286 } |
287 | 287 |
288 void NotifyRequestComplete(int request_id, size_t total_size) { | 288 void NotifyRequestComplete(int request_id, size_t total_size) { |
289 ResourceRequestCompletionStatus request_complete_data; | 289 ResourceRequestCompletionStatus request_complete_data; |
(...skipping 606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
896 ResourceResponseHead response_head; | 896 ResourceResponseHead response_head; |
897 | 897 |
898 PerformTest(response_head); | 898 PerformTest(response_head); |
899 | 899 |
900 EXPECT_EQ(base::TimeTicks(), response_info().load_timing.request_start); | 900 EXPECT_EQ(base::TimeTicks(), response_info().load_timing.request_start); |
901 EXPECT_EQ(base::TimeTicks(), | 901 EXPECT_EQ(base::TimeTicks(), |
902 response_info().load_timing.connect_timing.dns_start); | 902 response_info().load_timing.connect_timing.dns_start); |
903 } | 903 } |
904 | 904 |
905 } // namespace content | 905 } // namespace content |
OLD | NEW |