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

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

Issue 398903002: Plumb redirect info out of net, through content, and into child processes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: darin comments Created 6 years, 4 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
« no previous file with comments | « content/child/web_url_loader_impl.cc ('k') | content/common/resource_messages.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "content/child/web_url_loader_impl.h" 5 #include "content/child/web_url_loader_impl.h"
6 6
7 #include <string.h> 7 #include <string.h>
8 8
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/memory/weak_ptr.h" 10 #include "base/memory/weak_ptr.h"
11 #include "base/message_loop/message_loop.h" 11 #include "base/message_loop/message_loop.h"
12 #include "content/child/resource_dispatcher.h" 12 #include "content/child/resource_dispatcher.h"
13 #include "content/public/child/request_peer.h" 13 #include "content/public/child/request_peer.h"
14 #include "content/public/common/resource_response_info.h" 14 #include "content/public/common/resource_response_info.h"
15 #include "net/base/net_errors.h" 15 #include "net/base/net_errors.h"
16 #include "net/http/http_response_headers.h" 16 #include "net/http/http_response_headers.h"
17 #include "net/http/http_util.h" 17 #include "net/http/http_util.h"
18 #include "net/url_request/redirect_info.h"
18 #include "testing/gtest/include/gtest/gtest.h" 19 #include "testing/gtest/include/gtest/gtest.h"
19 #include "third_party/WebKit/public/platform/WebString.h" 20 #include "third_party/WebKit/public/platform/WebString.h"
20 #include "third_party/WebKit/public/platform/WebURLError.h" 21 #include "third_party/WebKit/public/platform/WebURLError.h"
21 #include "third_party/WebKit/public/platform/WebURLLoaderClient.h" 22 #include "third_party/WebKit/public/platform/WebURLLoaderClient.h"
22 #include "third_party/WebKit/public/platform/WebURLRequest.h" 23 #include "third_party/WebKit/public/platform/WebURLRequest.h"
23 #include "url/gurl.h" 24 #include "url/gurl.h"
24 #include "webkit/child/resource_loader_bridge.h" 25 #include "webkit/child/resource_loader_bridge.h"
25 26
26 namespace content { 27 namespace content {
27 namespace { 28 namespace {
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 blink::WebURLRequest request; 275 blink::WebURLRequest request;
275 request.initialize(); 276 request.initialize();
276 request.setURL(GURL(kTestURL)); 277 request.setURL(GURL(kTestURL));
277 client()->loader()->loadAsynchronously(request, client()); 278 client()->loader()->loadAsynchronously(request, client());
278 ASSERT_TRUE(bridge()); 279 ASSERT_TRUE(bridge());
279 ASSERT_TRUE(peer()); 280 ASSERT_TRUE(peer());
280 } 281 }
281 282
282 void DoReceiveRedirect() { 283 void DoReceiveRedirect() {
283 EXPECT_FALSE(client()->did_receive_redirect()); 284 EXPECT_FALSE(client()->did_receive_redirect());
284 peer()->OnReceivedRedirect(GURL(kTestURL), GURL(kTestURL), 285 net::RedirectInfo redirect_info;
286 redirect_info.status_code = 302;
287 redirect_info.new_method = "GET";
288 redirect_info.new_url = GURL(kTestURL);
289 redirect_info.new_first_party_for_cookies = GURL(kTestURL);
290 peer()->OnReceivedRedirect(redirect_info,
285 content::ResourceResponseInfo()); 291 content::ResourceResponseInfo());
286 EXPECT_TRUE(client()->did_receive_redirect()); 292 EXPECT_TRUE(client()->did_receive_redirect());
287 } 293 }
288 294
289 void DoReceiveResponse() { 295 void DoReceiveResponse() {
290 EXPECT_FALSE(client()->did_receive_response()); 296 EXPECT_FALSE(client()->did_receive_response());
291 peer()->OnReceivedResponse(content::ResourceResponseInfo()); 297 peer()->OnReceivedResponse(content::ResourceResponseInfo());
292 EXPECT_TRUE(client()->did_receive_response()); 298 EXPECT_TRUE(client()->did_receive_response());
293 } 299 }
294 300
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
634 client()->set_delete_on_fail(); 640 client()->set_delete_on_fail();
635 DoStartAsyncRequest(); 641 DoStartAsyncRequest();
636 DoReceiveResponseMultipart(); 642 DoReceiveResponseMultipart();
637 DoReceiveDataMultipart(); 643 DoReceiveDataMultipart();
638 DoFailRequest(); 644 DoFailRequest();
639 EXPECT_FALSE(bridge()); 645 EXPECT_FALSE(bridge());
640 } 646 }
641 647
642 } // namespace 648 } // namespace
643 } // namespace content 649 } // namespace content
OLDNEW
« no previous file with comments | « content/child/web_url_loader_impl.cc ('k') | content/common/resource_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698