Chromium Code Reviews| Index: content/browser/loader/resource_dispatcher_host_unittest.cc |
| diff --git a/content/browser/loader/resource_dispatcher_host_unittest.cc b/content/browser/loader/resource_dispatcher_host_unittest.cc |
| index 58ab2d130de3b48e182428775f96848d09560f55..d86757e0696f66bef9dffb67ed4ce852b7cf5432 100644 |
| --- a/content/browser/loader/resource_dispatcher_host_unittest.cc |
| +++ b/content/browser/loader/resource_dispatcher_host_unittest.cc |
| @@ -836,7 +836,7 @@ class TestWebContentsObserver : public WebContentsObserver { |
| // Information used to create resource requests that use URLRequestLoadInfoJobs. |
| // The child_id is just that of ResourceDispatcherHostTest::filter_. |
| struct LoadInfoTestRequestInfo { |
| - int route_id; |
| + GlobalFrameRoutingId route_id; |
| GURL url; |
| net::LoadState load_state; |
| net::UploadProgress upload_progress; |
| @@ -937,7 +937,9 @@ class ResourceDispatcherHostTest : public testing::TestWithParam<TestConfig>, |
| loader_test_request_info_.reset( |
| new LoadInfoTestRequestInfo(request_info[i])); |
| wait_for_request_create_loop_.reset(new base::RunLoop()); |
| - MakeTestRequest(request_info[i].route_id, i + 1, request_info[i].url); |
| + MakeTestRequestWithRenderFrame( |
| + 0, request_info[i].route_id.frame_routing_id, i + 1, |
|
nasko
2016/06/01 16:54:00
Don't use 0, use MSG_ROUTING_NONE, as there is no
Charlie Harrison
2016/06/02 14:22:28
Done.
|
| + request_info[i].url, RESOURCE_TYPE_SUB_RESOURCE); |
| wait_for_request_create_loop_->Run(); |
| wait_for_request_create_loop_.reset(); |
| } |
| @@ -3592,19 +3594,13 @@ TEST_P(ResourceDispatcherHostTest, LoadInfoNoRequests) { |
| // Tests GetLoadInfoForAllRoutes when there are 3 requests from the same |
| // RenderView. The second one is farthest along. |
| TEST_P(ResourceDispatcherHostTest, LoadInfo) { |
| - const GlobalRoutingID kId(filter_->child_id(), 0); |
| + const GlobalFrameRoutingId kId(filter_->child_id(), 0); |
|
nasko
2016/06/01 16:54:00
nit: I'd use a non-zero integer as zero is not a v
Charlie Harrison
2016/06/02 14:22:28
Done.
|
| LoadInfoTestRequestInfo request_info[] = { |
| - {kId.route_id, |
| - GURL("test://1/"), |
| - net::LOAD_STATE_SENDING_REQUEST, |
| + {kId, GURL("test://1/"), net::LOAD_STATE_SENDING_REQUEST, |
| net::UploadProgress(0, 0)}, |
| - {kId.route_id, |
| - GURL("test://2/"), |
| - net::LOAD_STATE_READING_RESPONSE, |
| + {kId, GURL("test://2/"), net::LOAD_STATE_READING_RESPONSE, |
| net::UploadProgress(0, 0)}, |
| - {kId.route_id, |
| - GURL("test://3/"), |
| - net::LOAD_STATE_SENDING_REQUEST, |
| + {kId, GURL("test://3/"), net::LOAD_STATE_SENDING_REQUEST, |
| net::UploadProgress(0, 0)}, |
| }; |
| std::unique_ptr<LoadInfoMap> load_info_map = |
| @@ -3621,16 +3617,10 @@ TEST_P(ResourceDispatcherHostTest, LoadInfo) { |
| // Tests GetLoadInfoForAllRoutes when there are 2 requests with the same |
| // priority. The first one (Which will have the lowest ID) should be returned. |
| TEST_P(ResourceDispatcherHostTest, LoadInfoSamePriority) { |
| - const GlobalRoutingID kId(filter_->child_id(), 0); |
| + const GlobalFrameRoutingId kId(filter_->child_id(), 0); |
| LoadInfoTestRequestInfo request_info[] = { |
| - {kId.route_id, |
| - GURL("test://1/"), |
| - net::LOAD_STATE_IDLE, |
| - net::UploadProgress(0, 0)}, |
| - {kId.route_id, |
| - GURL("test://2/"), |
| - net::LOAD_STATE_IDLE, |
| - net::UploadProgress(0, 0)}, |
| + {kId, GURL("test://1/"), net::LOAD_STATE_IDLE, net::UploadProgress(0, 0)}, |
| + {kId, GURL("test://2/"), net::LOAD_STATE_IDLE, net::UploadProgress(0, 0)}, |
| }; |
| std::unique_ptr<LoadInfoMap> load_info_map = |
| RunLoadInfoTest(request_info, arraysize(request_info)); |
| @@ -3644,27 +3634,17 @@ TEST_P(ResourceDispatcherHostTest, LoadInfoSamePriority) { |
| // Tests GetLoadInfoForAllRoutes when a request is uploading a body. |
| TEST_P(ResourceDispatcherHostTest, LoadInfoUploadProgress) { |
| - const GlobalRoutingID kId(filter_->child_id(), 0); |
| + const GlobalFrameRoutingId kId(filter_->child_id(), 0); |
| LoadInfoTestRequestInfo request_info[] = { |
| - {kId.route_id, |
| - GURL("test://1/"), |
| - net::LOAD_STATE_READING_RESPONSE, |
| + {kId, GURL("test://1/"), net::LOAD_STATE_READING_RESPONSE, |
| net::UploadProgress(0, 0)}, |
| - {kId.route_id, |
| - GURL("test://1/"), |
| - net::LOAD_STATE_READING_RESPONSE, |
| + {kId, GURL("test://1/"), net::LOAD_STATE_READING_RESPONSE, |
| net::UploadProgress(1000, 1000)}, |
| - {kId.route_id, |
| - GURL("test://2/"), |
| - net::LOAD_STATE_SENDING_REQUEST, |
| + {kId, GURL("test://2/"), net::LOAD_STATE_SENDING_REQUEST, |
| net::UploadProgress(50, 100)}, |
| - {kId.route_id, |
| - GURL("test://1/"), |
| - net::LOAD_STATE_READING_RESPONSE, |
| + {kId, GURL("test://1/"), net::LOAD_STATE_READING_RESPONSE, |
| net::UploadProgress(1000, 1000)}, |
| - {kId.route_id, |
| - GURL("test://3/"), |
| - net::LOAD_STATE_READING_RESPONSE, |
| + {kId, GURL("test://3/"), net::LOAD_STATE_READING_RESPONSE, |
| net::UploadProgress(0, 0)}, |
| }; |
| std::unique_ptr<LoadInfoMap> load_info_map = |
| @@ -3682,24 +3662,16 @@ TEST_P(ResourceDispatcherHostTest, LoadInfoUploadProgress) { |
| // RenderViews. Also tests the case where the first / last requests are the |
| // most interesting ones. |
| TEST_P(ResourceDispatcherHostTest, LoadInfoTwoRenderViews) { |
| - const GlobalRoutingID kId1(filter_->child_id(), 0); |
| - const GlobalRoutingID kId2(filter_->child_id(), 1); |
| + const GlobalFrameRoutingId kId1(filter_->child_id(), 0); |
| + const GlobalFrameRoutingId kId2(filter_->child_id(), 1); |
| LoadInfoTestRequestInfo request_info[] = { |
| - {kId1.route_id, |
| - GURL("test://1/"), |
| - net::LOAD_STATE_CONNECTING, |
| + {kId1, GURL("test://1/"), net::LOAD_STATE_CONNECTING, |
| net::UploadProgress(0, 0)}, |
| - {kId2.route_id, |
| - GURL("test://2/"), |
| - net::LOAD_STATE_IDLE, |
| + {kId2, GURL("test://2/"), net::LOAD_STATE_IDLE, |
| net::UploadProgress(0, 0)}, |
| - {kId1.route_id, |
| - GURL("test://3/"), |
| - net::LOAD_STATE_IDLE, |
| + {kId1, GURL("test://3/"), net::LOAD_STATE_IDLE, |
| net::UploadProgress(0, 0)}, |
| - {kId2.route_id, |
| - GURL("test://4/"), |
| - net::LOAD_STATE_CONNECTING, |
| + {kId2, GURL("test://4/"), net::LOAD_STATE_CONNECTING, |
| net::UploadProgress(0, 0)}, |
| }; |
| std::unique_ptr<LoadInfoMap> load_info_map = |