| 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 <string> | 5 #include <string> |
| 6 #include <vector> | 6 #include <vector> |
| 7 | 7 |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/process/process.h" | 10 #include "base/process/process.h" |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 int data_length, | 63 int data_length, |
| 64 int encoded_data_length) OVERRIDE { | 64 int encoded_data_length) OVERRIDE { |
| 65 EXPECT_FALSE(complete_); | 65 EXPECT_FALSE(complete_); |
| 66 data_.append(data, data_length); | 66 data_.append(data, data_length); |
| 67 total_encoded_data_length_ += encoded_data_length; | 67 total_encoded_data_length_ += encoded_data_length; |
| 68 } | 68 } |
| 69 | 69 |
| 70 virtual void OnCompletedRequest( | 70 virtual void OnCompletedRequest( |
| 71 int error_code, | 71 int error_code, |
| 72 bool was_ignored_by_handler, | 72 bool was_ignored_by_handler, |
| 73 bool stale_copy_in_cache, |
| 73 const std::string& security_info, | 74 const std::string& security_info, |
| 74 const base::TimeTicks& completion_time) OVERRIDE { | 75 const base::TimeTicks& completion_time) OVERRIDE { |
| 75 EXPECT_FALSE(complete_); | 76 EXPECT_FALSE(complete_); |
| 76 complete_ = true; | 77 complete_ = true; |
| 77 } | 78 } |
| 78 | 79 |
| 79 bool complete() const { | 80 bool complete() const { |
| 80 return complete_; | 81 return complete_; |
| 81 } | 82 } |
| 82 const std::string& data() const { | 83 const std::string& data() const { |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 virtual void OnReceivedData(const char* data, | 289 virtual void OnReceivedData(const char* data, |
| 289 int data_length, | 290 int data_length, |
| 290 int encoded_data_length) OVERRIDE { | 291 int encoded_data_length) OVERRIDE { |
| 291 EXPECT_EQ(defer_loading_, false); | 292 EXPECT_EQ(defer_loading_, false); |
| 292 set_defer_loading(false); | 293 set_defer_loading(false); |
| 293 } | 294 } |
| 294 | 295 |
| 295 virtual void OnCompletedRequest( | 296 virtual void OnCompletedRequest( |
| 296 int error_code, | 297 int error_code, |
| 297 bool was_ignored_by_handler, | 298 bool was_ignored_by_handler, |
| 299 bool stale_copy_in_cache, |
| 298 const std::string& security_info, | 300 const std::string& security_info, |
| 299 const base::TimeTicks& completion_time) OVERRIDE { | 301 const base::TimeTicks& completion_time) OVERRIDE { |
| 300 } | 302 } |
| 301 | 303 |
| 302 protected: | 304 protected: |
| 303 virtual void SetUp() OVERRIDE { | 305 virtual void SetUp() OVERRIDE { |
| 304 ResourceDispatcherTest::SetUp(); | 306 ResourceDispatcherTest::SetUp(); |
| 305 shared_handle_.Delete(kShmemSegmentName); | 307 shared_handle_.Delete(kShmemSegmentName); |
| 306 EXPECT_TRUE(shared_handle_.CreateNamed(kShmemSegmentName, false, 100)); | 308 EXPECT_TRUE(shared_handle_.CreateNamed(kShmemSegmentName, false, 100)); |
| 307 } | 309 } |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 375 } | 377 } |
| 376 | 378 |
| 377 virtual void OnReceivedData(const char* data, | 379 virtual void OnReceivedData(const char* data, |
| 378 int data_length, | 380 int data_length, |
| 379 int encoded_data_length) OVERRIDE { | 381 int encoded_data_length) OVERRIDE { |
| 380 } | 382 } |
| 381 | 383 |
| 382 virtual void OnCompletedRequest( | 384 virtual void OnCompletedRequest( |
| 383 int error_code, | 385 int error_code, |
| 384 bool was_ignored_by_handler, | 386 bool was_ignored_by_handler, |
| 387 bool stale_copy_in_cache, |
| 385 const std::string& security_info, | 388 const std::string& security_info, |
| 386 const base::TimeTicks& completion_time) OVERRIDE { | 389 const base::TimeTicks& completion_time) OVERRIDE { |
| 387 } | 390 } |
| 388 | 391 |
| 389 const ResourceResponseInfo& response_info() const { return response_info_; } | 392 const ResourceResponseInfo& response_info() const { return response_info_; } |
| 390 | 393 |
| 391 private: | 394 private: |
| 392 ResourceResponseInfo response_info_; | 395 ResourceResponseInfo response_info_; |
| 393 }; | 396 }; |
| 394 | 397 |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 431 response_head.error_code = net::OK; | 434 response_head.error_code = net::OK; |
| 432 | 435 |
| 433 PerformTest(response_head); | 436 PerformTest(response_head); |
| 434 | 437 |
| 435 EXPECT_EQ(base::TimeTicks(), response_info().load_timing.request_start); | 438 EXPECT_EQ(base::TimeTicks(), response_info().load_timing.request_start); |
| 436 EXPECT_EQ(base::TimeTicks(), | 439 EXPECT_EQ(base::TimeTicks(), |
| 437 response_info().load_timing.connect_timing.dns_start); | 440 response_info().load_timing.connect_timing.dns_start); |
| 438 } | 441 } |
| 439 | 442 |
| 440 } // namespace content | 443 } // namespace content |
| OLD | NEW |