Skip to content
Snippets Groups Projects
Commit c1f1b29c authored by Junyu Lai's avatar Junyu Lai Committed by Gerrit Code Review
Browse files

Merge "Fix thread leak in HttpEngineTest" into main

parents d4215623 54fddc3e
No related branches found
No related tags found
No related merge requests found
......@@ -247,10 +247,8 @@ public class HttpEngineTest {
@Test
public void testHttpEngine_requestUsesDefaultUserAgent() throws Exception {
mEngine = mEngineBuilder.build();
HttpCtsTestServer server =
new HttpCtsTestServer(ApplicationProvider.getApplicationContext());
String url = server.getUserAgentUrl();
String url = mTestServer.getUserAgentUrl();
UrlRequest request =
mEngine.newUrlRequestBuilder(url, mCallback.getExecutor(), mCallback).build();
request.start();
......@@ -266,14 +264,12 @@ public class HttpEngineTest {
@Test
public void testHttpEngine_requestUsesCustomUserAgent() throws Exception {
String userAgent = "CtsTests User Agent";
HttpCtsTestServer server =
new HttpCtsTestServer(ApplicationProvider.getApplicationContext());
mEngine =
new HttpEngine.Builder(ApplicationProvider.getApplicationContext())
.setUserAgent(userAgent)
.build();
String url = server.getUserAgentUrl();
String url = mTestServer.getUserAgentUrl();
UrlRequest request =
mEngine.newUrlRequestBuilder(url, mCallback.getExecutor(), mCallback).build();
request.start();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment