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

Side by Side Diff: ios/net/protocol_handler_util_unittest.mm

Issue 2262063002: Adjust callers and networking delegates in ios/ to modified APIs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@URLRequestRead
Patch Set: typo Created 4 years, 3 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
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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 #import "ios/net/protocol_handler_util.h" 5 #import "ios/net/protocol_handler_util.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/mac/scoped_nsobject.h" 10 #include "base/mac/scoped_nsobject.h"
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 void CheckDataResponse(NSURLResponse* response, 143 void CheckDataResponse(NSURLResponse* response,
144 const std::string& mime_type, 144 const std::string& mime_type,
145 const std::string& encoding) { 145 const std::string& encoding) {
146 EXPECT_NSEQ(base::SysUTF8ToNSString(mime_type), [response MIMEType]); 146 EXPECT_NSEQ(base::SysUTF8ToNSString(mime_type), [response MIMEType]);
147 EXPECT_NSEQ(base::SysUTF8ToNSString(encoding), [response textEncodingName]); 147 EXPECT_NSEQ(base::SysUTF8ToNSString(encoding), [response textEncodingName]);
148 // The response class must be NSURLResponse (and not NSHTTPURLResponse) when 148 // The response class must be NSURLResponse (and not NSHTTPURLResponse) when
149 // the scheme is "data". 149 // the scheme is "data".
150 EXPECT_TRUE([response isMemberOfClass:[NSURLResponse class]]); 150 EXPECT_TRUE([response isMemberOfClass:[NSURLResponse class]]);
151 } 151 }
152 152
153 void OnResponseStarted(URLRequest* request) override {} 153 void OnResponseStarted(URLRequest* request, int net_error) override {}
154 void OnReadCompleted(URLRequest* request, int bytes_read) override {} 154 void OnReadCompleted(URLRequest* request, int bytes_read) override {}
155 155
156 protected: 156 protected:
157 base::MessageLoop loop_; 157 base::MessageLoop loop_;
158 URLRequestJobFactoryImpl job_factory_; 158 URLRequestJobFactoryImpl job_factory_;
159 std::unique_ptr<URLRequestContext> request_context_; 159 std::unique_ptr<URLRequestContext> request_context_;
160 }; 160 };
161 161
162 } // namespace 162 } // namespace
163 163
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 // Some headers are added by default if missing. 271 // Some headers are added by default if missing.
272 const HttpRequestHeaders& headers = out_request->extra_request_headers(); 272 const HttpRequestHeaders& headers = out_request->extra_request_headers();
273 std::string header; 273 std::string header;
274 EXPECT_TRUE(headers.GetHeader("Accept", &header)); 274 EXPECT_TRUE(headers.GetHeader("Accept", &header));
275 EXPECT_EQ("*/*", header); 275 EXPECT_EQ("*/*", header);
276 EXPECT_TRUE(headers.GetHeader("Content-Type", &header)); 276 EXPECT_TRUE(headers.GetHeader("Content-Type", &header));
277 EXPECT_EQ("application/x-www-form-urlencoded", header); 277 EXPECT_EQ("application/x-www-form-urlencoded", header);
278 } 278 }
279 279
280 } // namespace net 280 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698