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/browser/renderer_host/resource_dispatcher_host_impl.h" | 5 #include "content/browser/renderer_host/resource_dispatcher_host_impl.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
(...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
495 bool msg_was_ok; | 495 bool msg_was_ok; |
496 host_.OnMessageReceived(msg, filter, &msg_was_ok); | 496 host_.OnMessageReceived(msg, filter, &msg_was_ok); |
497 KickOffRequest(); | 497 KickOffRequest(); |
498 } | 498 } |
499 | 499 |
500 void ResourceDispatcherHostTest::CancelRequest(int request_id) { | 500 void ResourceDispatcherHostTest::CancelRequest(int request_id) { |
501 host_.CancelRequest(filter_->child_id(), request_id, false); | 501 host_.CancelRequest(filter_->child_id(), request_id, false); |
502 } | 502 } |
503 | 503 |
504 void ResourceDispatcherHostTest::PauseRequest(int request_id) { | 504 void ResourceDispatcherHostTest::PauseRequest(int request_id) { |
| 505 // TODO(darin): Replace with a ResourceThrottle implementation. |
505 host_.PauseRequest(filter_->child_id(), request_id, true); | 506 host_.PauseRequest(filter_->child_id(), request_id, true); |
506 } | 507 } |
507 | 508 |
508 void ResourceDispatcherHostTest::ResumeRequest(int request_id) { | 509 void ResourceDispatcherHostTest::ResumeRequest(int request_id) { |
509 host_.PauseRequest(filter_->child_id(), request_id, false); | 510 host_.ResumeDeferredRequest(filter_->child_id(), request_id); |
510 } | 511 } |
511 | 512 |
512 void ResourceDispatcherHostTest::CompleteStartRequest(int request_id) { | 513 void ResourceDispatcherHostTest::CompleteStartRequest(int request_id) { |
513 GlobalRequestID gid(filter_->child_id(), request_id); | 514 GlobalRequestID gid(filter_->child_id(), request_id); |
514 net::URLRequest* req = host_.GetURLRequest(gid); | 515 net::URLRequest* req = host_.GetURLRequest(gid); |
515 EXPECT_TRUE(req); | 516 EXPECT_TRUE(req); |
516 if (req) | 517 if (req) |
517 URLRequestTestDelayedStartJob::CompleteStart(req); | 518 URLRequestTestDelayedStartJob::CompleteStart(req); |
518 } | 519 } |
519 | 520 |
(...skipping 876 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1396 PickleIterator iter(msgs[0][0]); | 1397 PickleIterator iter(msgs[0][0]); |
1397 EXPECT_TRUE(IPC::ReadParam(&msgs[0][0], &iter, &request_id)); | 1398 EXPECT_TRUE(IPC::ReadParam(&msgs[0][0], &iter, &request_id)); |
1398 EXPECT_TRUE(IPC::ReadParam(&msgs[0][0], &iter, &status)); | 1399 EXPECT_TRUE(IPC::ReadParam(&msgs[0][0], &iter, &status)); |
1399 | 1400 |
1400 EXPECT_EQ(1, request_id); | 1401 EXPECT_EQ(1, request_id); |
1401 EXPECT_EQ(net::URLRequestStatus::FAILED, status.status()); | 1402 EXPECT_EQ(net::URLRequestStatus::FAILED, status.status()); |
1402 EXPECT_EQ(net::ERR_UNKNOWN_URL_SCHEME, status.error()); | 1403 EXPECT_EQ(net::ERR_UNKNOWN_URL_SCHEME, status.error()); |
1403 } | 1404 } |
1404 | 1405 |
1405 } // namespace content | 1406 } // namespace content |
OLD | NEW |