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

Unified Diff: net/proxy/proxy_script_fetcher_impl_unittest.cc

Issue 11412070: Fix and enable the PAC fetcher NoCache test on Android (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: address eroman remark Created 8 years, 1 month 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 | « build/android/gtest_filter/net_unittests_disabled ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/proxy/proxy_script_fetcher_impl_unittest.cc
diff --git a/net/proxy/proxy_script_fetcher_impl_unittest.cc b/net/proxy/proxy_script_fetcher_impl_unittest.cc
index 39d223c9753951d4c3cacce0a305ff4f65bc799b..7a25c5516b8f4ef30d13f1db28ba22f6e5aa399c 100644
--- a/net/proxy/proxy_script_fetcher_impl_unittest.cc
+++ b/net/proxy/proxy_script_fetcher_impl_unittest.cc
@@ -319,6 +319,7 @@ TEST_F(ProxyScriptFetcherImplTest, ContentDisposition) {
EXPECT_EQ(ASCIIToUTF16("-downloadable.pac-\n"), text);
}
+// Verifies that PAC scripts are not being cached.
TEST_F(ProxyScriptFetcherImplTest, NoCache) {
ASSERT_TRUE(test_server_.Start());
@@ -335,18 +336,27 @@ TEST_F(ProxyScriptFetcherImplTest, NoCache) {
EXPECT_EQ(ASCIIToUTF16("-cacheable_1hr.pac-\n"), text);
}
- // Now kill the HTTP server.
+ // Kill the HTTP server.
ASSERT_TRUE(test_server_.Stop());
- // Try to fetch the file again -- if should fail, since the server is not
- // running anymore. (If it were instead being loaded from cache, we would
- // get a success.
+ // Try to fetch the file again. Since the server is not running anymore, the
+ // call should fail, thus indicating that the file was not fetched from the
+ // local cache.
{
string16 text;
TestCompletionCallback callback;
int result = pac_fetcher.Fetch(url, &text, callback.callback());
EXPECT_EQ(ERR_IO_PENDING, result);
+
+#if defined(OS_ANDROID)
+ // On Android platform, the tests are run on the device while the server
+ // runs on the host machine. After killing the server, port forwarder
+ // running on the device is still active, which produces error message
+ // "Connection reset by peer" rather than "Connection refused".
+ EXPECT_EQ(ERR_CONNECTION_RESET, callback.WaitForResult());
+#else
EXPECT_EQ(ERR_CONNECTION_REFUSED, callback.WaitForResult());
+#endif
}
}
« no previous file with comments | « build/android/gtest_filter/net_unittests_disabled ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698