| 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/resource_dispatcher.h" | 13 #include "content/child/resource_dispatcher.h" |
| 14 #include "content/common/resource_messages.h" | 14 #include "content/common/resource_messages.h" |
| 15 #include "content/common/service_worker/service_worker_types.h" |
| 15 #include "content/public/common/resource_response.h" | 16 #include "content/public/common/resource_response.h" |
| 16 #include "net/base/net_errors.h" | 17 #include "net/base/net_errors.h" |
| 17 #include "net/http/http_response_headers.h" | 18 #include "net/http/http_response_headers.h" |
| 18 #include "testing/gtest/include/gtest/gtest.h" | 19 #include "testing/gtest/include/gtest/gtest.h" |
| 19 #include "webkit/common/appcache/appcache_interfaces.h" | 20 #include "webkit/common/appcache/appcache_interfaces.h" |
| 20 | 21 |
| 21 using webkit_glue::ResourceLoaderBridge; | 22 using webkit_glue::ResourceLoaderBridge; |
| 22 using webkit_glue::ResourceResponseInfo; | 23 using webkit_glue::ResourceResponseInfo; |
| 23 | 24 |
| 24 namespace content { | 25 namespace content { |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 request_info.headers = std::string(); | 172 request_info.headers = std::string(); |
| 172 request_info.load_flags = 0; | 173 request_info.load_flags = 0; |
| 173 request_info.requestor_pid = 0; | 174 request_info.requestor_pid = 0; |
| 174 request_info.request_type = ResourceType::SUB_RESOURCE; | 175 request_info.request_type = ResourceType::SUB_RESOURCE; |
| 175 request_info.appcache_host_id = appcache::kNoHostId; | 176 request_info.appcache_host_id = appcache::kNoHostId; |
| 176 request_info.routing_id = 0; | 177 request_info.routing_id = 0; |
| 177 RequestExtraData extra_data(blink::WebPageVisibilityStateVisible, | 178 RequestExtraData extra_data(blink::WebPageVisibilityStateVisible, |
| 178 blink::WebString(), | 179 blink::WebString(), |
| 179 false, MSG_ROUTING_NONE, true, GURL(), | 180 false, MSG_ROUTING_NONE, true, GURL(), |
| 180 false, -1, true, | 181 false, -1, true, |
| 181 PAGE_TRANSITION_LINK, false, -1, -1); | 182 PAGE_TRANSITION_LINK, false, -1, -1, |
| 183 kInvalidServiceWorkerProviderId); |
| 182 request_info.extra_data = &extra_data; | 184 request_info.extra_data = &extra_data; |
| 183 | 185 |
| 184 return dispatcher_->CreateBridge(request_info); | 186 return dispatcher_->CreateBridge(request_info); |
| 185 } | 187 } |
| 186 | 188 |
| 187 std::vector<IPC::Message> message_queue_; | 189 std::vector<IPC::Message> message_queue_; |
| 188 static scoped_ptr<ResourceDispatcher> dispatcher_; | 190 static scoped_ptr<ResourceDispatcher> dispatcher_; |
| 189 }; | 191 }; |
| 190 | 192 |
| 191 /*static*/ | 193 /*static*/ |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 437 response_head.error_code = net::OK; | 439 response_head.error_code = net::OK; |
| 438 | 440 |
| 439 PerformTest(response_head); | 441 PerformTest(response_head); |
| 440 | 442 |
| 441 EXPECT_EQ(base::TimeTicks(), response_info().load_timing.request_start); | 443 EXPECT_EQ(base::TimeTicks(), response_info().load_timing.request_start); |
| 442 EXPECT_EQ(base::TimeTicks(), | 444 EXPECT_EQ(base::TimeTicks(), |
| 443 response_info().load_timing.connect_timing.dns_start); | 445 response_info().load_timing.connect_timing.dns_start); |
| 444 } | 446 } |
| 445 | 447 |
| 446 } // namespace content | 448 } // namespace content |
| OLD | NEW |