| Index: components/cronet/ios/test/cronet_http_test.mm
|
| diff --git a/components/cronet/ios/test/cronet_http_test.mm b/components/cronet/ios/test/cronet_http_test.mm
|
| index 4b3e7465b530f5373aab28c06d654fde0e48ebf8..b511cbd89d59910e2d221c6658c85b088880a674 100644
|
| --- a/components/cronet/ios/test/cronet_http_test.mm
|
| +++ b/components/cronet/ios/test/cronet_http_test.mm
|
| @@ -10,8 +10,9 @@
|
| #include "base/logging.h"
|
| #include "base/mac/scoped_nsobject.h"
|
| #include "base/strings/sys_string_conversions.h"
|
| -#include "components/cronet/ios/test/quic_test_server.h"
|
| +#include "components/cronet/ios/test/start_cronet.h"
|
| #include "components/cronet/ios/test/test_server.h"
|
| +#include "components/grpc_support/test/quic_test_server.h"
|
| #include "net/base/mac/url_conversions.h"
|
| #include "net/base/net_errors.h"
|
| #include "net/cert/mock_cert_verifier.h"
|
| @@ -112,9 +113,6 @@ namespace cronet {
|
| static const int64_t ns_in_second = 1000000000LL;
|
| const char kUserAgent[] = "CronetTest/1.0.0.0";
|
|
|
| -// TODO(mef): Create common header file to declare this.
|
| -void StartCronetIfNecessary();
|
| -
|
| class HttpTest : public ::testing::Test {
|
| protected:
|
| HttpTest() {}
|
| @@ -132,12 +130,12 @@ class HttpTest : public ::testing::Test {
|
| // Take a reference to the session and store it so it doesn't get
|
| // deallocated until this object does.
|
| session_.reset([session retain]);
|
| - StartQuicTestServer();
|
| + grpc_support::StartQuicTestServer();
|
| TestServer::Start();
|
| }
|
|
|
| void TearDown() override {
|
| - ShutdownQuicTestServer();
|
| + grpc_support::ShutdownQuicTestServer();
|
| TestServer::Shutdown();
|
| }
|
|
|
| @@ -155,21 +153,23 @@ class HttpTest : public ::testing::Test {
|
| };
|
|
|
| TEST_F(HttpTest, NSURLSessionReceivesData) {
|
| - NSURL* url = net::NSURLWithGURL(GURL(kTestServerUrl));
|
| + NSURL* url = net::NSURLWithGURL(GURL(grpc_support::kTestServerUrl));
|
| NSURLSessionDataTask* task = [session_ dataTaskWithURL:url];
|
| StartDataTaskAndWaitForCompletion(task);
|
| EXPECT_EQ(nil, [delegate_ error]);
|
| - EXPECT_STREQ(kHelloBodyValue, [[delegate_ responseBody] UTF8String]);
|
| + EXPECT_STREQ(grpc_support::kHelloBodyValue,
|
| + base::SysNSStringToUTF8([delegate_ responseBody]));
|
| }
|
|
|
| TEST_F(HttpTest, GetGlobalMetricsDeltas) {
|
| NSData* delta1 = [Cronet getGlobalMetricsDeltas];
|
|
|
| - NSURL* url = net::NSURLWithGURL(GURL(kTestServerUrl));
|
| + NSURL* url = net::NSURLWithGURL(GURL(grpc_support::kTestServerUrl));
|
| NSURLSessionDataTask* task = [session_ dataTaskWithURL:url];
|
| StartDataTaskAndWaitForCompletion(task);
|
| EXPECT_EQ(nil, [delegate_ error]);
|
| - EXPECT_STREQ(kHelloBodyValue, [[delegate_ responseBody] UTF8String]);
|
| + EXPECT_STREQ(grpc_support::kHelloBodyValue,
|
| + base::SysNSStringToUTF8([delegate_ responseBody]));
|
|
|
| NSData* delta2 = [Cronet getGlobalMetricsDeltas];
|
| EXPECT_FALSE([delta2 isEqualToData:delta1]);
|
|
|