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 <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" |
11 #include "base/process/process_handle.h" | 11 #include "base/process/process_handle.h" |
12 #include "content/child/request_extra_data.h" | 12 #include "content/child/request_extra_data.h" |
| 13 #include "content/child/request_info.h" |
13 #include "content/child/resource_dispatcher.h" | 14 #include "content/child/resource_dispatcher.h" |
14 #include "content/common/resource_messages.h" | 15 #include "content/common/resource_messages.h" |
15 #include "content/common/service_worker/service_worker_types.h" | 16 #include "content/common/service_worker/service_worker_types.h" |
16 #include "content/public/common/resource_response.h" | 17 #include "content/public/common/resource_response.h" |
17 #include "net/base/net_errors.h" | 18 #include "net/base/net_errors.h" |
18 #include "net/http/http_response_headers.h" | 19 #include "net/http/http_response_headers.h" |
19 #include "testing/gtest/include/gtest/gtest.h" | 20 #include "testing/gtest/include/gtest/gtest.h" |
20 #include "webkit/common/appcache/appcache_interfaces.h" | 21 #include "webkit/common/appcache/appcache_interfaces.h" |
21 | 22 |
22 using webkit_glue::ResourceLoaderBridge; | 23 using webkit_glue::ResourceLoaderBridge; |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 protected: | 156 protected: |
156 // testing::Test | 157 // testing::Test |
157 virtual void SetUp() OVERRIDE { | 158 virtual void SetUp() OVERRIDE { |
158 dispatcher_.reset(new ResourceDispatcher(this)); | 159 dispatcher_.reset(new ResourceDispatcher(this)); |
159 } | 160 } |
160 virtual void TearDown() OVERRIDE { | 161 virtual void TearDown() OVERRIDE { |
161 dispatcher_.reset(); | 162 dispatcher_.reset(); |
162 } | 163 } |
163 | 164 |
164 ResourceLoaderBridge* CreateBridge() { | 165 ResourceLoaderBridge* CreateBridge() { |
165 webkit_glue::ResourceLoaderBridge::RequestInfo request_info; | 166 RequestInfo request_info; |
166 request_info.method = "GET"; | 167 request_info.method = "GET"; |
167 request_info.url = GURL(test_page_url); | 168 request_info.url = GURL(test_page_url); |
168 request_info.first_party_for_cookies = GURL(test_page_url); | 169 request_info.first_party_for_cookies = GURL(test_page_url); |
169 request_info.referrer = GURL(); | 170 request_info.referrer = GURL(); |
170 request_info.headers = std::string(); | 171 request_info.headers = std::string(); |
171 request_info.load_flags = 0; | 172 request_info.load_flags = 0; |
172 request_info.requestor_pid = 0; | 173 request_info.requestor_pid = 0; |
173 request_info.request_type = ResourceType::SUB_RESOURCE; | 174 request_info.request_type = ResourceType::SUB_RESOURCE; |
174 request_info.appcache_host_id = appcache::kNoHostId; | 175 request_info.appcache_host_id = appcache::kNoHostId; |
175 request_info.routing_id = 0; | 176 request_info.routing_id = 0; |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
435 response_head.error_code = net::OK; | 436 response_head.error_code = net::OK; |
436 | 437 |
437 PerformTest(response_head); | 438 PerformTest(response_head); |
438 | 439 |
439 EXPECT_EQ(base::TimeTicks(), response_info().load_timing.request_start); | 440 EXPECT_EQ(base::TimeTicks(), response_info().load_timing.request_start); |
440 EXPECT_EQ(base::TimeTicks(), | 441 EXPECT_EQ(base::TimeTicks(), |
441 response_info().load_timing.connect_timing.dns_start); | 442 response_info().load_timing.connect_timing.dns_start); |
442 } | 443 } |
443 | 444 |
444 } // namespace content | 445 } // namespace content |
OLD | NEW |