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