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

Side by Side Diff: components/cronet/android/test/native_test_server.cc

Issue 2401413002: Fix testGetResponseAfterWriteFailed flake (Closed)
Patch Set: self review Created 4 years, 2 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #include "components/cronet/android/test/native_test_server.h" 5 #include "components/cronet/android/test/native_test_server.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 // Add a third handler for paths that NativeTestServerRequestHandler does not 227 // Add a third handler for paths that NativeTestServerRequestHandler does not
228 // handle. 228 // handle.
229 g_test_server->ServeFilesFromDirectory(test_files_root); 229 g_test_server->ServeFilesFromDirectory(test_files_root);
230 return g_test_server->Start(); 230 return g_test_server->Start();
231 } 231 }
232 232
233 void ShutdownNativeTestServer(JNIEnv* env, 233 void ShutdownNativeTestServer(JNIEnv* env,
234 const JavaParamRef<jclass>& jcaller) { 234 const JavaParamRef<jclass>& jcaller) {
235 if (!g_test_server) 235 if (!g_test_server)
236 return; 236 return;
237 CHECK(g_test_server->ShutdownAndWaitUntilComplete());
237 delete g_test_server; 238 delete g_test_server;
pauljensen 2016/10/10 12:56:21 Doesn't this line already do this? https://cs.chro
xunjieli 2016/10/10 13:04:44 ah, that's a good point. I forgot about it :(
238 g_test_server = NULL; 239 g_test_server = NULL;
239 } 240 }
240 241
241 ScopedJavaLocalRef<jstring> GetEchoBodyURL( 242 ScopedJavaLocalRef<jstring> GetEchoBodyURL(
242 JNIEnv* env, 243 JNIEnv* env,
243 const JavaParamRef<jclass>& jcaller) { 244 const JavaParamRef<jclass>& jcaller) {
244 DCHECK(g_test_server); 245 DCHECK(g_test_server);
245 GURL url = g_test_server->GetURL(kEchoBodyPath); 246 GURL url = g_test_server->GetURL(kEchoBodyPath);
246 return base::android::ConvertUTF8ToJavaString(env, url.spec()); 247 return base::android::ConvertUTF8ToJavaString(env, url.spec());
247 } 248 }
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 #else 322 #else
322 return JNI_FALSE; 323 return JNI_FALSE;
323 #endif 324 #endif
324 } 325 }
325 326
326 bool RegisterNativeTestServer(JNIEnv* env) { 327 bool RegisterNativeTestServer(JNIEnv* env) {
327 return RegisterNativesImpl(env); 328 return RegisterNativesImpl(env);
328 } 329 }
329 330
330 } // namespace cronet 331 } // namespace cronet
OLDNEW
« 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