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

Unified Diff: components/cronet/ios/test/cronet_http_test.mm

Issue 2836063005: [cronet] Add mechanism for restarting CronetEnvironment (Closed)
Patch Set: sync Created 3 years, 7 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 | « components/cronet/ios/cronet_environment.mm ('k') | components/cronet/ios/test/cronet_netlog_test.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 b83a8a1cac8bd6ac0ff316178afc9bc65f11e1da..aa5d462b6fdb4a9add29ef14a95477f8ce1443c0 100644
--- a/components/cronet/ios/test/cronet_http_test.mm
+++ b/components/cronet/ios/test/cronet_http_test.mm
@@ -21,6 +21,10 @@
#include "url/gurl.h"
+@interface Cronet (ExposedForTesting)
++ (void)shutdownForTesting;
+@end
+
@interface TestDelegate : NSObject<NSURLSessionDataDelegate,
NSURLSessionDelegate,
NSURLSessionTaskDelegate>
@@ -140,7 +144,7 @@ class HttpTest : public ::testing::Test {
[Cronet setRequestFilterBlock:^(NSURLRequest* request) {
return YES;
}];
- StartCronetIfNecessary(grpc_support::GetQuicTestServerPort());
+ StartCronet(grpc_support::GetQuicTestServerPort());
[Cronet registerHttpProtocolHandler];
NSURLSessionConfiguration* config =
[NSURLSessionConfiguration ephemeralSessionConfiguration];
@@ -157,6 +161,9 @@ class HttpTest : public ::testing::Test {
void TearDown() override {
grpc_support::ShutdownQuicTestServer();
TestServer::Shutdown();
+
+ [Cronet stopNetLog];
+ [Cronet shutdownForTesting];
}
// Launches the supplied |task| and blocks until it completes, with a timeout
« no previous file with comments | « components/cronet/ios/cronet_environment.mm ('k') | components/cronet/ios/test/cronet_netlog_test.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698