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

Side by Side Diff: components/cronet/ios/test/cronet_http_test.mm

Issue 2803443002: Revert of [cronet] Expose API to set experimental options (Closed)
Patch Set: Created 3 years, 8 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 | « components/cronet/ios/cronet_environment.mm ('k') | components/cronet/ios/test/start_cronet.mm » ('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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 <Cronet/Cronet.h> 5 #import <Cronet/Cronet.h>
6 #import <Foundation/Foundation.h> 6 #import <Foundation/Foundation.h>
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 [task resume]; 156 [task resume];
157 int64_t deadline_ns = 1 * ns_in_second; 157 int64_t deadline_ns = 1 * ns_in_second;
158 dispatch_semaphore_wait([delegate_ semaphore], 158 dispatch_semaphore_wait([delegate_ semaphore],
159 dispatch_time(DISPATCH_TIME_NOW, deadline_ns)); 159 dispatch_time(DISPATCH_TIME_NOW, deadline_ns));
160 } 160 }
161 161
162 base::scoped_nsobject<NSURLSession> session_; 162 base::scoped_nsobject<NSURLSession> session_;
163 base::scoped_nsobject<TestDelegate> delegate_; 163 base::scoped_nsobject<TestDelegate> delegate_;
164 }; 164 };
165 165
166 TEST(SslTest, CreateFile) {
167 bool ssl_file_created = [[NSFileManager defaultManager]
168 fileExistsAtPath:[Cronet getNetLogPathForFile:@"SSLKEYLOGFILE"]];
169
170 [[NSFileManager defaultManager]
171 removeItemAtPath:[Cronet getNetLogPathForFile:@"SSLKEYLOGFILE"]
172 error:nil];
173
174 EXPECT_TRUE(ssl_file_created);
175 }
176
177 TEST_F(HttpTest, NSURLSessionReceivesData) { 166 TEST_F(HttpTest, NSURLSessionReceivesData) {
178 NSURL* url = net::NSURLWithGURL(GURL(grpc_support::kTestServerUrl)); 167 NSURL* url = net::NSURLWithGURL(GURL(grpc_support::kTestServerUrl));
179 __block BOOL block_used = NO; 168 __block BOOL block_used = NO;
180 NSURLSessionDataTask* task = [session_ dataTaskWithURL:url]; 169 NSURLSessionDataTask* task = [session_ dataTaskWithURL:url];
181 [Cronet setRequestFilterBlock:^(NSURLRequest* request) { 170 [Cronet setRequestFilterBlock:^(NSURLRequest* request) {
182 block_used = YES; 171 block_used = YES;
183 EXPECT_EQ([request URL], url); 172 EXPECT_EQ([request URL], url);
184 return YES; 173 return YES;
185 }]; 174 }];
186 StartDataTaskAndWaitForCompletion(task); 175 StartDataTaskAndWaitForCompletion(task);
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
420 [Cronet setRequestFilterBlock:^(NSURLRequest* request) { 409 [Cronet setRequestFilterBlock:^(NSURLRequest* request) {
421 EXPECT_TRUE(false) << "Block should not be called for unsupported requests"; 410 EXPECT_TRUE(false) << "Block should not be called for unsupported requests";
422 return YES; 411 return YES;
423 }]; 412 }];
424 StartDataTaskAndWaitForCompletion(task); 413 StartDataTaskAndWaitForCompletion(task);
425 EXPECT_EQ(nil, [delegate_ error]); 414 EXPECT_EQ(nil, [delegate_ error]);
426 EXPECT_TRUE([[delegate_ responseBody] containsString:testString]); 415 EXPECT_TRUE([[delegate_ responseBody] containsString:testString]);
427 } 416 }
428 417
429 } // namespace cronet 418 } // namespace cronet
OLDNEW
« no previous file with comments | « components/cronet/ios/cronet_environment.mm ('k') | components/cronet/ios/test/start_cronet.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698