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

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

Issue 183993004: Tease apart ServiceWorkerNetworkProvider from other stuff. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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"
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
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 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
440 response_head.error_code = net::OK; 442 response_head.error_code = net::OK;
441 443
442 PerformTest(response_head); 444 PerformTest(response_head);
443 445
444 EXPECT_EQ(base::TimeTicks(), response_info().load_timing.request_start); 446 EXPECT_EQ(base::TimeTicks(), response_info().load_timing.request_start);
445 EXPECT_EQ(base::TimeTicks(), 447 EXPECT_EQ(base::TimeTicks(),
446 response_info().load_timing.connect_timing.dns_start); 448 response_info().load_timing.connect_timing.dns_start);
447 } 449 }
448 450
449 } // namespace content 451 } // namespace content
OLDNEW
« no previous file with comments | « content/child/request_extra_data.cc ('k') | content/child/service_worker/service_worker_network_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698