blob: 7ff9ac3357dc192da4a798710c916197085e5221 [file] [log] [blame]
[email protected]80744782012-05-04 01:47:001// Copyright (c) 2012 The Chromium Authors. All rights reserved.
license.botbf09a502008-08-24 00:55:552// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
initial.commit09911bf2008-07-26 23:55:294
5#include <string>
6#include <vector>
7
[email protected]3b63f8f42011-03-28 01:54:158#include "base/memory/scoped_ptr.h"
[email protected]e55f5642013-07-18 00:22:549#include "base/message_loop/message_loop.h"
[email protected]54724e22013-07-25 13:02:1510#include "base/process/process.h"
11#include "base/process/process_handle.h"
[email protected]541b7b02013-06-07 00:59:3412#include "content/child/request_extra_data.h"
[email protected]10208ea2013-06-06 20:08:0313#include "content/child/resource_dispatcher.h"
[email protected]94dc971d2011-03-05 19:08:3214#include "content/common/resource_messages.h"
[email protected]2336ffe2011-11-24 01:23:3415#include "content/public/common/resource_response.h"
[email protected]2756a8e2012-09-07 18:24:2916#include "net/base/net_errors.h"
[email protected]7a4de7a62010-08-17 18:38:2417#include "net/http/http_response_headers.h"
initial.commit09911bf2008-07-26 23:55:2918#include "testing/gtest/include/gtest/gtest.h"
[email protected]d5b2fdf2013-06-05 09:36:5519#include "webkit/common/appcache/appcache_interfaces.h"
initial.commit09911bf2008-07-26 23:55:2920
21using webkit_glue::ResourceLoaderBridge;
[email protected]b4b3a912010-10-08 19:05:3722using webkit_glue::ResourceResponseInfo;
initial.commit09911bf2008-07-26 23:55:2923
[email protected]be7b41e82012-07-04 09:46:5124namespace content {
25
initial.commit09911bf2008-07-26 23:55:2926static const char test_page_url[] = "http://www.google.com/";
27static const char test_page_headers[] =
28 "HTTP/1.1 200 OK\nContent-Type:text/html\n\n";
29static const char test_page_mime_type[] = "text/html";
30static const char test_page_charset[] = "";
31static const char test_page_contents[] =
32 "<html><head><title>Google</title></head><body><h1>Google</h1></body></html>";
[email protected]b5ab3982010-02-16 23:58:2733static const uint32 test_page_contents_len = arraysize(test_page_contents) - 1;
initial.commit09911bf2008-07-26 23:55:2934
[email protected]b8901082010-11-12 01:14:2835static const char kShmemSegmentName[] = "DeferredResourceLoaderTest";
36
initial.commit09911bf2008-07-26 23:55:2937// Listens for request response data and stores it so that it can be compared
38// to the reference data.
39class TestRequestCallback : public ResourceLoaderBridge::Peer {
40 public:
41 TestRequestCallback() : complete_(false) {
42 }
43
[email protected]04f6f982012-08-03 01:02:1544 virtual void OnUploadProgress(uint64 position, uint64 size) OVERRIDE {
[email protected]bb551622010-07-22 20:52:4945 }
46
[email protected]6568a9e32009-07-30 18:01:3947 virtual bool OnReceivedRedirect(
48 const GURL& new_url,
[email protected]b4b3a912010-10-08 19:05:3749 const ResourceResponseInfo& info,
[email protected]041b0bbb2009-11-18 02:27:3450 bool* has_new_first_party_for_cookies,
[email protected]04f6f982012-08-03 01:02:1551 GURL* new_first_party_for_cookies) OVERRIDE {
[email protected]041b0bbb2009-11-18 02:27:3452 *has_new_first_party_for_cookies = false;
[email protected]6568a9e32009-07-30 18:01:3953 return true;
initial.commit09911bf2008-07-26 23:55:2954 }
55
[email protected]04f6f982012-08-03 01:02:1556 virtual void OnReceivedResponse(const ResourceResponseInfo& info) OVERRIDE {
initial.commit09911bf2008-07-26 23:55:2957 }
58
[email protected]ad554bc2013-09-03 21:18:4759 virtual void OnDownloadedData(int len, int encoded_data_length) OVERRIDE {
[email protected]bb551622010-07-22 20:52:4960 }
61
[email protected]8bd0de72011-04-08 18:52:1062 virtual void OnReceivedData(const char* data,
63 int data_length,
[email protected]04f6f982012-08-03 01:02:1564 int encoded_data_length) OVERRIDE {
initial.commit09911bf2008-07-26 23:55:2965 EXPECT_FALSE(complete_);
[email protected]8bd0de72011-04-08 18:52:1066 data_.append(data, data_length);
[email protected]dfd682172011-04-13 19:57:2567 total_encoded_data_length_ += encoded_data_length;
initial.commit09911bf2008-07-26 23:55:2968 }
69
[email protected]04f6f982012-08-03 01:02:1570 virtual void OnCompletedRequest(
[email protected]2756a8e2012-09-07 18:24:2971 int error_code,
72 bool was_ignored_by_handler,
[email protected]dcbe3df2014-02-06 23:08:3773 bool stale_copy_in_cache,
[email protected]04f6f982012-08-03 01:02:1574 const std::string& security_info,
[email protected]c3e35892013-02-12 02:08:0175 const base::TimeTicks& completion_time) OVERRIDE {
initial.commit09911bf2008-07-26 23:55:2976 EXPECT_FALSE(complete_);
77 complete_ = true;
78 }
79
[email protected]8bd0de72011-04-08 18:52:1080 bool complete() const {
81 return complete_;
82 }
initial.commit09911bf2008-07-26 23:55:2983 const std::string& data() const {
84 return data_;
85 }
[email protected]dfd682172011-04-13 19:57:2586 int total_encoded_data_length() const {
87 return total_encoded_data_length_;
initial.commit09911bf2008-07-26 23:55:2988 }
89
90 private:
91 bool complete_;
92 std::string data_;
[email protected]dfd682172011-04-13 19:57:2593 int total_encoded_data_length_;
initial.commit09911bf2008-07-26 23:55:2994};
95
96
97// Sets up the message sender override for the unit test
[email protected]d84effeb2012-06-25 17:03:1098class ResourceDispatcherTest : public testing::Test, public IPC::Sender {
initial.commit09911bf2008-07-26 23:55:2999 public:
[email protected]d84effeb2012-06-25 17:03:10100 // Emulates IPC send operations (IPC::Sender) by adding
initial.commit09911bf2008-07-26 23:55:29101 // pending messages to the queue.
[email protected]c3e35892013-02-12 02:08:01102 virtual bool Send(IPC::Message* msg) OVERRIDE {
initial.commit09911bf2008-07-26 23:55:29103 message_queue_.push_back(IPC::Message(*msg));
104 delete msg;
105 return true;
106 }
107
108 // Emulates the browser process and processes the pending IPC messages,
109 // returning the hardcoded file contents.
110 void ProcessMessages() {
111 while (!message_queue_.empty()) {
initial.commit09911bf2008-07-26 23:55:29112 int request_id;
[email protected]94dc971d2011-03-05 19:08:32113 ResourceHostMsg_Request request;
114 ASSERT_TRUE(ResourceHostMsg_RequestResource::Read(
[email protected]eb9989092009-03-12 21:42:52115 &message_queue_[0], &request_id, &request));
initial.commit09911bf2008-07-26 23:55:29116
117 // check values
118 EXPECT_EQ(test_page_url, request.url.spec());
119
120 // received response message
[email protected]be7b41e82012-07-04 09:46:51121 ResourceResponseHead response;
initial.commit09911bf2008-07-26 23:55:29122 std::string raw_headers(test_page_headers);
123 std::replace(raw_headers.begin(), raw_headers.end(), '\n', '\0');
124 response.headers = new net::HttpResponseHeaders(raw_headers);
125 response.mime_type = test_page_mime_type;
126 response.charset = test_page_charset;
initial.commit09911bf2008-07-26 23:55:29127 dispatcher_->OnReceivedResponse(request_id, response);
128
129 // received data message with the test contents
[email protected]176aa482008-11-14 03:25:15130 base::SharedMemory shared_mem;
[email protected]54e3dfa22010-10-27 18:16:06131 EXPECT_TRUE(shared_mem.CreateAndMapAnonymous(test_page_contents_len));
initial.commit09911bf2008-07-26 23:55:29132 char* put_data_here = static_cast<char*>(shared_mem.memory());
133 memcpy(put_data_here, test_page_contents, test_page_contents_len);
[email protected]176aa482008-11-14 03:25:15134 base::SharedMemoryHandle dup_handle;
[email protected]4003d7142009-01-12 12:56:20135 EXPECT_TRUE(shared_mem.GiveToProcess(
136 base::Process::Current().handle(), &dup_handle));
[email protected]f4653192013-09-06 19:24:05137 dispatcher_->OnSetDataBuffer(request_id, dup_handle,
[email protected]9d9387e2013-01-12 16:55:08138 test_page_contents_len, 0);
[email protected]f4653192013-09-06 19:24:05139 dispatcher_->OnReceivedData(request_id, 0, test_page_contents_len,
[email protected]f0fa1ab2012-09-18 06:28:38140 test_page_contents_len);
initial.commit09911bf2008-07-26 23:55:29141
142 message_queue_.erase(message_queue_.begin());
143
144 // read the ack message.
[email protected]c2fe31542009-05-20 18:24:14145 Tuple1<int> request_ack;
[email protected]94dc971d2011-03-05 19:08:32146 ASSERT_TRUE(ResourceHostMsg_DataReceived_ACK::Read(
[email protected]eb9989092009-03-12 21:42:52147 &message_queue_[0], &request_ack));
initial.commit09911bf2008-07-26 23:55:29148
[email protected]c2fe31542009-05-20 18:24:14149 ASSERT_EQ(request_ack.a, request_id);
initial.commit09911bf2008-07-26 23:55:29150
151 message_queue_.erase(message_queue_.begin());
152 }
153 }
154
155 protected:
initial.commit09911bf2008-07-26 23:55:29156 // testing::Test
[email protected]04f6f982012-08-03 01:02:15157 virtual void SetUp() OVERRIDE {
[email protected]eb9989092009-03-12 21:42:52158 dispatcher_.reset(new ResourceDispatcher(this));
initial.commit09911bf2008-07-26 23:55:29159 }
[email protected]04f6f982012-08-03 01:02:15160 virtual void TearDown() OVERRIDE {
[email protected]eb9989092009-03-12 21:42:52161 dispatcher_.reset();
initial.commit09911bf2008-07-26 23:55:29162 }
163
[email protected]2602087e2009-08-24 23:12:16164 ResourceLoaderBridge* CreateBridge() {
[email protected]46b0d4a2009-12-19 00:46:33165 webkit_glue::ResourceLoaderBridge::RequestInfo request_info;
166 request_info.method = "GET";
167 request_info.url = GURL(test_page_url);
168 request_info.first_party_for_cookies = GURL(test_page_url);
169 request_info.referrer = GURL();
[email protected]46b0d4a2009-12-19 00:46:33170 request_info.headers = std::string();
171 request_info.load_flags = 0;
172 request_info.requestor_pid = 0;
173 request_info.request_type = ResourceType::SUB_RESOURCE;
[email protected]52bbcd932010-01-06 18:56:12174 request_info.appcache_host_id = appcache::kNoHostId;
175 request_info.routing_id = 0;
[email protected]cacbd7a2014-02-04 01:26:02176 RequestExtraData extra_data(blink::WebPageVisibilityStateVisible,
[email protected]180ef242013-11-07 06:50:46177 blink::WebString(),
[email protected]60eca4eb2013-12-06 00:02:16178 false, MSG_ROUTING_NONE, true, 0, GURL(),
[email protected]15b5a542013-08-23 23:55:37179 false, -1, true,
[email protected]4972fc82013-11-19 04:33:42180 PAGE_TRANSITION_LINK, false, -1, -1);
[email protected]940895b2011-08-20 00:50:05181 request_info.extra_data = &extra_data;
[email protected]46b0d4a2009-12-19 00:46:33182
[email protected]50285ff2011-03-11 23:10:56183 return dispatcher_->CreateBridge(request_info);
[email protected]2602087e2009-08-24 23:12:16184 }
185
initial.commit09911bf2008-07-26 23:55:29186 std::vector<IPC::Message> message_queue_;
[email protected]eb9989092009-03-12 21:42:52187 static scoped_ptr<ResourceDispatcher> dispatcher_;
initial.commit09911bf2008-07-26 23:55:29188};
189
190/*static*/
[email protected]eb9989092009-03-12 21:42:52191scoped_ptr<ResourceDispatcher> ResourceDispatcherTest::dispatcher_;
initial.commit09911bf2008-07-26 23:55:29192
193// Does a simple request and tests that the correct data is received.
194TEST_F(ResourceDispatcherTest, RoundTrip) {
195 TestRequestCallback callback;
[email protected]2602087e2009-08-24 23:12:16196 ResourceLoaderBridge* bridge = CreateBridge();
initial.commit09911bf2008-07-26 23:55:29197
198 bridge->Start(&callback);
199
200 ProcessMessages();
201
202 // FIXME(brettw) when the request complete messages are actually handledo
203 // and dispatched, uncomment this.
204 //EXPECT_TRUE(callback.complete());
205 //EXPECT_STREQ(test_page_contents, callback.data().c_str());
[email protected]dfd682172011-04-13 19:57:25206 //EXPECT_EQ(test_page_contents_len, callback.total_encoded_data_length());
initial.commit09911bf2008-07-26 23:55:29207
208 delete bridge;
209}
210
211// Tests that the request IDs are straight when there are multiple requests.
212TEST_F(ResourceDispatcherTest, MultipleRequests) {
213 // FIXME
214}
215
216// Tests that the cancel method prevents other messages from being received
217TEST_F(ResourceDispatcherTest, Cancel) {
218 // FIXME
219}
220
221TEST_F(ResourceDispatcherTest, Cookies) {
222 // FIXME
223}
224
225TEST_F(ResourceDispatcherTest, SerializedPostData) {
226 // FIXME
227}
[email protected]2602087e2009-08-24 23:12:16228
229// This class provides functionality to validate whether the ResourceDispatcher
230// object honors the deferred loading contract correctly, i.e. if deferred
231// loading is enabled it should queue up any responses received. If deferred
232// loading is enabled/disabled in the context of a dispatched message, other
233// queued messages should not be dispatched until deferred load is turned off.
234class DeferredResourceLoadingTest : public ResourceDispatcherTest,
235 public ResourceLoaderBridge::Peer {
236 public:
237 DeferredResourceLoadingTest()
238 : defer_loading_(false) {
239 }
240
[email protected]04f6f982012-08-03 01:02:15241 virtual bool Send(IPC::Message* msg) OVERRIDE {
[email protected]2602087e2009-08-24 23:12:16242 delete msg;
243 return true;
244 }
245
246 void InitMessages() {
247 set_defer_loading(true);
248
[email protected]be7b41e82012-07-04 09:46:51249 ResourceResponseHead response_head;
[email protected]2756a8e2012-09-07 18:24:29250 response_head.error_code = net::OK;
[email protected]2602087e2009-08-24 23:12:16251
[email protected]04f6f982012-08-03 01:02:15252 dispatcher_->OnMessageReceived(
[email protected]f4653192013-09-06 19:24:05253 ResourceMsg_ReceivedResponse(0, response_head));
[email protected]2602087e2009-08-24 23:12:16254
[email protected]a68114f72009-11-30 23:32:49255 // Duplicate the shared memory handle so both the test and the callee can
256 // close their copy.
257 base::SharedMemoryHandle duplicated_handle;
258 EXPECT_TRUE(shared_handle_.ShareToProcess(base::GetCurrentProcessHandle(),
259 &duplicated_handle));
260
[email protected]04f6f982012-08-03 01:02:15261 dispatcher_->OnMessageReceived(
[email protected]f4653192013-09-06 19:24:05262 ResourceMsg_SetDataBuffer(0, duplicated_handle, 100, 0));
263 dispatcher_->OnMessageReceived(ResourceMsg_DataReceived(0, 0, 100, 100));
[email protected]2602087e2009-08-24 23:12:16264
265 set_defer_loading(false);
266 }
267
268 // ResourceLoaderBridge::Peer methods.
[email protected]04f6f982012-08-03 01:02:15269 virtual void OnUploadProgress(uint64 position, uint64 size) OVERRIDE {
[email protected]2602087e2009-08-24 23:12:16270 }
271
272 virtual bool OnReceivedRedirect(
273 const GURL& new_url,
[email protected]b4b3a912010-10-08 19:05:37274 const ResourceResponseInfo& info,
[email protected]041b0bbb2009-11-18 02:27:34275 bool* has_new_first_party_for_cookies,
[email protected]04f6f982012-08-03 01:02:15276 GURL* new_first_party_for_cookies) OVERRIDE {
[email protected]041b0bbb2009-11-18 02:27:34277 *has_new_first_party_for_cookies = false;
[email protected]2602087e2009-08-24 23:12:16278 return true;
279 }
280
[email protected]04f6f982012-08-03 01:02:15281 virtual void OnReceivedResponse(const ResourceResponseInfo& info) OVERRIDE {
[email protected]bb551622010-07-22 20:52:49282 EXPECT_EQ(defer_loading_, false);
283 set_defer_loading(true);
284 }
285
[email protected]ad554bc2013-09-03 21:18:47286 virtual void OnDownloadedData(int len, int encoded_data_length) OVERRIDE {
[email protected]bb551622010-07-22 20:52:49287 }
288
[email protected]8bd0de72011-04-08 18:52:10289 virtual void OnReceivedData(const char* data,
290 int data_length,
[email protected]04f6f982012-08-03 01:02:15291 int encoded_data_length) OVERRIDE {
[email protected]2602087e2009-08-24 23:12:16292 EXPECT_EQ(defer_loading_, false);
293 set_defer_loading(false);
294 }
295
[email protected]04f6f982012-08-03 01:02:15296 virtual void OnCompletedRequest(
[email protected]2756a8e2012-09-07 18:24:29297 int error_code,
298 bool was_ignored_by_handler,
[email protected]dcbe3df2014-02-06 23:08:37299 bool stale_copy_in_cache,
[email protected]04f6f982012-08-03 01:02:15300 const std::string& security_info,
[email protected]c3e35892013-02-12 02:08:01301 const base::TimeTicks& completion_time) OVERRIDE {
[email protected]2602087e2009-08-24 23:12:16302 }
303
[email protected]2602087e2009-08-24 23:12:16304 protected:
[email protected]04f6f982012-08-03 01:02:15305 virtual void SetUp() OVERRIDE {
[email protected]2602087e2009-08-24 23:12:16306 ResourceDispatcherTest::SetUp();
[email protected]b8901082010-11-12 01:14:28307 shared_handle_.Delete(kShmemSegmentName);
[email protected]515f2492011-01-14 10:36:28308 EXPECT_TRUE(shared_handle_.CreateNamed(kShmemSegmentName, false, 100));
[email protected]2602087e2009-08-24 23:12:16309 }
310
[email protected]04f6f982012-08-03 01:02:15311 virtual void TearDown() OVERRIDE {
[email protected]2602087e2009-08-24 23:12:16312 shared_handle_.Close();
[email protected]b8901082010-11-12 01:14:28313 EXPECT_TRUE(shared_handle_.Delete(kShmemSegmentName));
[email protected]2602087e2009-08-24 23:12:16314 ResourceDispatcherTest::TearDown();
315 }
316
317 private:
318 void set_defer_loading(bool defer) {
319 defer_loading_ = defer;
320 dispatcher_->SetDefersLoading(0, defer);
321 }
322
323 bool defer_loading() const {
324 return defer_loading_;
325 }
326
327 bool defer_loading_;
328 base::SharedMemory shared_handle_;
329};
330
331TEST_F(DeferredResourceLoadingTest, DeferredLoadTest) {
[email protected]1ef90012014-01-15 22:24:33332 base::MessageLoopForIO message_loop;
[email protected]2602087e2009-08-24 23:12:16333
334 ResourceLoaderBridge* bridge = CreateBridge();
335
336 bridge->Start(this);
337 InitMessages();
338
339 // Dispatch deferred messages.
[email protected]f319ace2012-11-10 19:07:29340 message_loop.RunUntilIdle();
[email protected]2602087e2009-08-24 23:12:16341 delete bridge;
342}
[email protected]be7b41e82012-07-04 09:46:51343
[email protected]04f6f982012-08-03 01:02:15344class TimeConversionTest : public ResourceDispatcherTest,
345 public ResourceLoaderBridge::Peer {
346 public:
347 virtual bool Send(IPC::Message* msg) OVERRIDE {
348 delete msg;
349 return true;
350 }
351
352 void PerformTest(const ResourceResponseHead& response_head) {
353 scoped_ptr<ResourceLoaderBridge> bridge(CreateBridge());
354 bridge->Start(this);
355
356 dispatcher_->OnMessageReceived(
[email protected]f4653192013-09-06 19:24:05357 ResourceMsg_ReceivedResponse(0, response_head));
[email protected]04f6f982012-08-03 01:02:15358 }
359
360 // ResourceLoaderBridge::Peer methods.
361 virtual void OnUploadProgress(uint64 position, uint64 size) OVERRIDE {
362 }
363
364 virtual bool OnReceivedRedirect(
365 const GURL& new_url,
366 const ResourceResponseInfo& info,
367 bool* has_new_first_party_for_cookies,
[email protected]c3e35892013-02-12 02:08:01368 GURL* new_first_party_for_cookies) OVERRIDE {
[email protected]04f6f982012-08-03 01:02:15369 return true;
370 }
371
372 virtual void OnReceivedResponse(const ResourceResponseInfo& info) OVERRIDE {
373 response_info_ = info;
374 }
375
[email protected]ad554bc2013-09-03 21:18:47376 virtual void OnDownloadedData(int len, int encoded_data_length) OVERRIDE {
[email protected]04f6f982012-08-03 01:02:15377 }
378
379 virtual void OnReceivedData(const char* data,
380 int data_length,
381 int encoded_data_length) OVERRIDE {
382 }
383
384 virtual void OnCompletedRequest(
[email protected]2756a8e2012-09-07 18:24:29385 int error_code,
386 bool was_ignored_by_handler,
[email protected]dcbe3df2014-02-06 23:08:37387 bool stale_copy_in_cache,
[email protected]04f6f982012-08-03 01:02:15388 const std::string& security_info,
389 const base::TimeTicks& completion_time) OVERRIDE {
390 }
391
392 const ResourceResponseInfo& response_info() const { return response_info_; }
393
394 private:
395 ResourceResponseInfo response_info_;
396};
397
398// TODO(simonjam): Enable this when 10829031 lands.
399TEST_F(TimeConversionTest, DISABLED_ProperlyInitialized) {
400 ResourceResponseHead response_head;
[email protected]2756a8e2012-09-07 18:24:29401 response_head.error_code = net::OK;
[email protected]04f6f982012-08-03 01:02:15402 response_head.request_start = base::TimeTicks::FromInternalValue(5);
403 response_head.response_start = base::TimeTicks::FromInternalValue(15);
[email protected]ec298802013-03-27 16:45:07404 response_head.load_timing.request_start_time = base::Time::Now();
405 response_head.load_timing.request_start =
406 base::TimeTicks::FromInternalValue(10);
407 response_head.load_timing.connect_timing.connect_start =
408 base::TimeTicks::FromInternalValue(13);
[email protected]04f6f982012-08-03 01:02:15409
410 PerformTest(response_head);
411
[email protected]ec298802013-03-27 16:45:07412 EXPECT_LT(base::TimeTicks(), response_info().load_timing.request_start);
413 EXPECT_EQ(base::TimeTicks(),
414 response_info().load_timing.connect_timing.dns_start);
415 EXPECT_LE(response_head.load_timing.request_start,
416 response_info().load_timing.connect_timing.connect_start);
[email protected]04f6f982012-08-03 01:02:15417}
418
419TEST_F(TimeConversionTest, PartiallyInitialized) {
420 ResourceResponseHead response_head;
[email protected]2756a8e2012-09-07 18:24:29421 response_head.error_code = net::OK;
[email protected]04f6f982012-08-03 01:02:15422 response_head.request_start = base::TimeTicks::FromInternalValue(5);
423 response_head.response_start = base::TimeTicks::FromInternalValue(15);
424
425 PerformTest(response_head);
426
[email protected]ec298802013-03-27 16:45:07427 EXPECT_EQ(base::TimeTicks(), response_info().load_timing.request_start);
428 EXPECT_EQ(base::TimeTicks(),
429 response_info().load_timing.connect_timing.dns_start);
[email protected]04f6f982012-08-03 01:02:15430}
431
432TEST_F(TimeConversionTest, NotInitialized) {
433 ResourceResponseHead response_head;
[email protected]2756a8e2012-09-07 18:24:29434 response_head.error_code = net::OK;
[email protected]04f6f982012-08-03 01:02:15435
436 PerformTest(response_head);
437
[email protected]ec298802013-03-27 16:45:07438 EXPECT_EQ(base::TimeTicks(), response_info().load_timing.request_start);
439 EXPECT_EQ(base::TimeTicks(),
440 response_info().load_timing.connect_timing.dns_start);
[email protected]04f6f982012-08-03 01:02:15441}
442
[email protected]be7b41e82012-07-04 09:46:51443} // namespace content