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

Unified Diff: ios/crnet/test/crnet_http_tests.mm

Issue 1680913002: Removed/Replaced uses of deprecated NSURLConnection methods. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Deleted NSURLConnection test case. Rebase. Created 4 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/crnet/test/crnet_http_tests.mm
diff --git a/ios/crnet/test/crnet_http_tests.mm b/ios/crnet/test/crnet_http_tests.mm
index ab24b3a20349d17fd09c6d4d9552309b49c89be1..af74ec0d7ce1a4833823e4fe6ec45dd9352546e0 100644
--- a/ios/crnet/test/crnet_http_tests.mm
+++ b/ios/crnet/test/crnet_http_tests.mm
@@ -194,21 +194,6 @@ class HttpTest : public ::testing::Test {
GURL server_root_;
};
-TEST_F(HttpTest, NSURLConnectionReceivesData) {
- const char kData[] = "foobar";
- const char kPath[] = "/foo";
- RegisterPathText(kPath, kData);
- StartWebServer();
-
- NSURL* url = net::NSURLWithGURL(GetURL(kPath));
- NSURLRequest* req = [NSURLRequest requestWithURL:url];
- NSURLResponse* resp = nil;
- NSData* received = [NSURLConnection sendSynchronousRequest:req
- returningResponse:&resp
- error:nullptr];
pkl (ping after 24h if needed) 2016/02/09 21:44:14 Note: +sendSynchronousRequest:returningResponse:er
Elly Fong-Jones 2016/02/10 13:44:12 You are probably fine to delete these tests, if yo
- EXPECT_EQ(0, memcmp([received bytes], kData, sizeof(kData)));
-}
-
TEST_F(HttpTest, NSURLSessionReceivesData) {
const char kPath[] = "/foo";
const char kData[] = "foobar";
@@ -231,13 +216,10 @@ TEST_F(HttpTest, SdchDisabledByDefault) {
});
StartWebServer();
NSURL* url = net::NSURLWithGURL(GetURL(kPath));
- NSURLRequest* req = [NSURLRequest requestWithURL:url];
- NSURLResponse* resp = nil;
- NSError* error = nil;
- NSData* received = [NSURLConnection sendSynchronousRequest:req
- returningResponse:&resp
- error:&error];
- DCHECK(received);
+ NSURLSessionDataTask* task = [session_ dataTaskWithURL:url];
+ StartDataTaskAndWaitForCompletion(task);
+ EXPECT_EQ(nil, [delegate_ error]);
+ EXPECT_TRUE([delegate_ receivedBytes]);
}
// TODO(ellyjones): There needs to be a test that enabling SDCH works, but
« 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