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

Side by Side Diff: content/test/weburl_loader_mock.cc

Issue 607383002: WebURLLoaderMock should set a request context for redirects. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/test/weburl_loader_mock.h" 5 #include "content/test/weburl_loader_mock.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "content/test/weburl_loader_mock_factory.h" 8 #include "content/test/weburl_loader_mock_factory.h"
9 #include "third_party/WebKit/public/platform/WebData.h" 9 #include "third_party/WebKit/public/platform/WebData.h"
10 #include "third_party/WebKit/public/platform/WebURLError.h" 10 #include "third_party/WebKit/public/platform/WebURLError.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 return; 51 return;
52 } 52 }
53 client_->didReceiveData(this, data.data(), data.size(), data.size()); 53 client_->didReceiveData(this, data.data(), data.size(), data.size());
54 client_->didFinishLoading(this, 0, data.size()); 54 client_->didFinishLoading(this, 0, data.size());
55 } 55 }
56 56
57 blink::WebURLRequest WebURLLoaderMock::ServeRedirect( 57 blink::WebURLRequest WebURLLoaderMock::ServeRedirect(
58 const blink::WebURLResponse& redirectResponse) { 58 const blink::WebURLResponse& redirectResponse) {
59 blink::WebURLRequest newRequest; 59 blink::WebURLRequest newRequest;
60 newRequest.initialize(); 60 newRequest.initialize();
61 newRequest.setRequestContext(blink::WebURLRequest::RequestContextInternal);
61 GURL redirectURL(redirectResponse.httpHeaderField("Location")); 62 GURL redirectURL(redirectResponse.httpHeaderField("Location"));
62 newRequest.setURL(redirectURL); 63 newRequest.setURL(redirectURL);
63 client_->willSendRequest(this, newRequest, redirectResponse); 64 client_->willSendRequest(this, newRequest, redirectResponse);
64 return newRequest; 65 return newRequest;
65 } 66 }
66 67
67 void WebURLLoaderMock::loadSynchronously(const blink::WebURLRequest& request, 68 void WebURLLoaderMock::loadSynchronously(const blink::WebURLRequest& request,
68 blink::WebURLResponse& response, 69 blink::WebURLResponse& response,
69 blink::WebURLError& error, 70 blink::WebURLError& error,
70 blink::WebData& data) { 71 blink::WebData& data) {
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 } 104 }
104 105
105 void WebURLLoaderMock::setDefersLoading(bool deferred) { 106 void WebURLLoaderMock::setDefersLoading(bool deferred) {
106 is_deferred_ = deferred; 107 is_deferred_ = deferred;
107 if (using_default_loader_) { 108 if (using_default_loader_) {
108 default_loader_->setDefersLoading(deferred); 109 default_loader_->setDefersLoading(deferred);
109 return; 110 return;
110 } 111 }
111 NOTIMPLEMENTED(); 112 NOTIMPLEMENTED();
112 } 113 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698