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

Unified Diff: net/url_request/url_request_unittest.cc

Issue 197030: Re-enabled URLRequestTestHTTP.BasicAuth.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Update the comment in http_response_info.h Created 11 years, 3 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
« no previous file with comments | « net/url_request/url_request.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/url_request/url_request_unittest.cc
===================================================================
--- net/url_request/url_request_unittest.cc (revision 25517)
+++ net/url_request/url_request_unittest.cc (working copy)
@@ -1207,8 +1207,6 @@
scoped_refptr<URLRequestContext> context = new URLRequestTestContext();
- Time response_time;
-
// populate the cache
{
TestDelegate d;
@@ -1217,14 +1215,8 @@
req.SetExtraRequestHeaders("foo:1");
req.Start();
MessageLoop::current()->Run();
-
- response_time = req.response_time();
}
- // Make sure that the response time of a future response will be in the
- // future!
- PlatformThread::Sleep(10);
-
// expect a cache hit
{
TestDelegate d;
@@ -1234,7 +1226,7 @@
req.Start();
MessageLoop::current()->Run();
- EXPECT_TRUE(req.response_time() == response_time);
+ EXPECT_TRUE(req.was_cached());
}
// expect a cache miss
@@ -1246,18 +1238,14 @@
req.Start();
MessageLoop::current()->Run();
- EXPECT_FALSE(req.response_time() == response_time);
+ EXPECT_FALSE(req.was_cached());
}
}
-// TODO(eroman): Broke with commit of r25484 -- this is depending on
-// the response time value.
-TEST_F(URLRequestTestHTTP, DISABLED_BasicAuth) {
+TEST_F(URLRequestTestHTTP, BasicAuth) {
scoped_refptr<URLRequestContext> context = new URLRequestTestContext();
ASSERT_TRUE(NULL != server_.get());
- Time response_time;
-
// populate the cache
{
TestDelegate d;
@@ -1271,14 +1259,8 @@
MessageLoop::current()->Run();
EXPECT_TRUE(d.data_received().find("user/secret") != std::string::npos);
-
- response_time = r.response_time();
}
- // Let some time pass so we can ensure that a future response will have a
- // response time value in the future.
- PlatformThread::Sleep(10 /* milliseconds */);
-
// repeat request with end-to-end validation. since auth-basic results in a
// cachable page, we expect this test to result in a 304. in which case, the
// response should be fetched from the cache.
@@ -1296,9 +1278,8 @@
EXPECT_TRUE(d.data_received().find("user/secret") != std::string::npos);
- // Should be the same cached document, which means that the response time
- // should not have changed.
- EXPECT_TRUE(response_time == r.response_time());
+ // Should be the same cached document.
+ EXPECT_TRUE(r.was_cached());
}
}
« no previous file with comments | « net/url_request/url_request.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698