Commit 049e5cdc authored by hush's avatar hush Committed by Commit bot

Always close the server in finally block.

BUG=

Review URL: https://codereview.chromium.org/508233002

Cr-Commit-Position: refs/heads/master@{#292246}
parent 4ff8121c
......@@ -2778,8 +2778,11 @@ public class AwSettingsTest extends AwTestBase {
awSettings.setJavaScriptEnabled(true);
TestWebServer httpsServer = new TestWebServer(true);
TestWebServer httpServer = new TestWebServer(false);
TestWebServer httpsServer = null;
TestWebServer httpServer = null;
try {
httpsServer = new TestWebServer(true);
httpServer = new TestWebServer(false);
final String JS_URL = "/insecure.js";
final String IMG_URL = "/insecure.png";
......@@ -2811,10 +2814,15 @@ public class AwSettingsTest extends AwTestBase {
assertEquals(3, httpsServer.getRequestCount(SECURE_URL));
assertEquals(1, httpServer.getRequestCount(JS_URL));
assertEquals(2, httpServer.getRequestCount(IMG_URL));
} finally {
if (httpServer != null) {
httpServer.shutdown();
}
if (httpsServer != null) {
httpsServer.shutdown();
}
}
}
static class ViewPair {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment