| 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());
|
| }
|
| }
|
|
|
|
|