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

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

Issue 2836063005: [cronet] Add mechanism for restarting CronetEnvironment (Closed)
Patch Set: per #21 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 side-by-side diff with in-line comments
Download patch
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 58185081938d23a4a681f663069287eff30f6fb7..2067ff6711ef2a79968a645ab8938ce6491b4993 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)
mef 2017/04/27 14:58:20 I wonder whether it makes sense to create a header
lilyhoughton 2017/05/01 15:31:35 I like this idea a lot. It probably makes sense a
mef 2017/05/01 19:12:58 sgtm
++ (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

Powered by Google App Engine
This is Rietveld 408576698