Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(191)

Side by Side Diff: content/child/resource_dispatcher_unittest.cc

Issue 182383015: Merge weburlrequest_extradata_impl.cc/h into content/child/request_extra_data.cc/h (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address all feedback Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 request_info.method = "GET"; 166 request_info.method = "GET";
167 request_info.url = GURL(test_page_url); 167 request_info.url = GURL(test_page_url);
168 request_info.first_party_for_cookies = GURL(test_page_url); 168 request_info.first_party_for_cookies = GURL(test_page_url);
169 request_info.referrer = GURL(); 169 request_info.referrer = GURL();
170 request_info.headers = std::string(); 170 request_info.headers = std::string();
171 request_info.load_flags = 0; 171 request_info.load_flags = 0;
172 request_info.requestor_pid = 0; 172 request_info.requestor_pid = 0;
173 request_info.request_type = ResourceType::SUB_RESOURCE; 173 request_info.request_type = ResourceType::SUB_RESOURCE;
174 request_info.appcache_host_id = appcache::kNoHostId; 174 request_info.appcache_host_id = appcache::kNoHostId;
175 request_info.routing_id = 0; 175 request_info.routing_id = 0;
176 RequestExtraData extra_data(blink::WebPageVisibilityStateVisible, 176 RequestExtraData* extra_data = new RequestExtraData();
177 blink::WebString(), 177 extra_data->set_visibility_state(blink::WebPageVisibilityStateVisible);
178 false, MSG_ROUTING_NONE, true, GURL(), 178 extra_data->set_custom_user_agent(blink::WebString());
179 false, -1, true, 179 extra_data->set_was_after_preconnect_request(false);
180 PAGE_TRANSITION_LINK, false, -1, -1, 180 extra_data->set_render_frame_id(MSG_ROUTING_NONE);
181 kInvalidServiceWorkerProviderId); 181 extra_data->set_is_main_frame(true);
182 request_info.extra_data = &extra_data; 182 extra_data->set_frame_origin(GURL());
183 extra_data->set_parent_is_main_frame(false);
184 extra_data->set_parent_render_frame_id(-1);
185 extra_data->set_allow_download(true);
186 extra_data->set_transition_type(PAGE_TRANSITION_LINK);
187 extra_data->set_should_replace_current_entry(false);
188 extra_data->set_transferred_request_child_id(-1);
189 extra_data->set_transferred_request_request_id(-1);
190 extra_data->set_service_worker_provider_id(kInvalidServiceWorkerProviderId);
191 request_info.extra_data = extra_data;
183 192
184 return dispatcher_->CreateBridge(request_info); 193 return dispatcher_->CreateBridge(request_info);
185 } 194 }
186 195
187 std::vector<IPC::Message> message_queue_; 196 std::vector<IPC::Message> message_queue_;
188 static scoped_ptr<ResourceDispatcher> dispatcher_; 197 static scoped_ptr<ResourceDispatcher> dispatcher_;
189 }; 198 };
190 199
191 /*static*/ 200 /*static*/
192 scoped_ptr<ResourceDispatcher> ResourceDispatcherTest::dispatcher_; 201 scoped_ptr<ResourceDispatcher> ResourceDispatcherTest::dispatcher_;
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
435 response_head.error_code = net::OK; 444 response_head.error_code = net::OK;
436 445
437 PerformTest(response_head); 446 PerformTest(response_head);
438 447
439 EXPECT_EQ(base::TimeTicks(), response_info().load_timing.request_start); 448 EXPECT_EQ(base::TimeTicks(), response_info().load_timing.request_start);
440 EXPECT_EQ(base::TimeTicks(), 449 EXPECT_EQ(base::TimeTicks(),
441 response_info().load_timing.connect_timing.dns_start); 450 response_info().load_timing.connect_timing.dns_start);
442 } 451 }
443 452
444 } // namespace content 453 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698