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

Side by Side Diff: net/url_request/url_request_unittest.cc

Issue 2398613002: [HttpCache] LOAD_ONLY_FROM_CACHE should not imply LOAD_PREFERRING_CACHE (Closed)
Patch Set: Always check vary Created 4 years, 2 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 unified diff | Download patch
« no previous file with comments | « net/url_request/sdch_dictionary_fetcher.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <memory> 5 #include <memory>
6 #include <utility> 6 #include <utility>
7 7
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "build/build_config.h" 10 #include "build/build_config.h"
(...skipping 7781 matching lines...) Expand 10 before | Expand all | Expand 10 after
7792 EXPECT_TRUE(req->response_info().was_cached); 7792 EXPECT_TRUE(req->response_info().was_cached);
7793 } 7793 }
7794 7794
7795 TEST_F(URLRequestTestHTTP, NetworkAccessedClearOnLoadOnlyFromCache) { 7795 TEST_F(URLRequestTestHTTP, NetworkAccessedClearOnLoadOnlyFromCache) {
7796 ASSERT_TRUE(http_test_server()->Start()); 7796 ASSERT_TRUE(http_test_server()->Start());
7797 7797
7798 TestDelegate d; 7798 TestDelegate d;
7799 GURL test_url(http_test_server()->GetURL("/")); 7799 GURL test_url(http_test_server()->GetURL("/"));
7800 std::unique_ptr<URLRequest> req( 7800 std::unique_ptr<URLRequest> req(
7801 default_context_.CreateRequest(test_url, DEFAULT_PRIORITY, &d)); 7801 default_context_.CreateRequest(test_url, DEFAULT_PRIORITY, &d));
7802 req->SetLoadFlags(LOAD_ONLY_FROM_CACHE); 7802 req->SetLoadFlags(LOAD_ONLY_FROM_CACHE | LOAD_SKIP_CACHE_VALIDATION);
7803 7803
7804 req->Start(); 7804 req->Start();
7805 base::RunLoop().Run(); 7805 base::RunLoop().Run();
7806 7806
7807 EXPECT_FALSE(req->response_info().network_accessed); 7807 EXPECT_FALSE(req->response_info().network_accessed);
7808 } 7808 }
7809 7809
7810 TEST_F(URLRequestTestHTTP, RawBodyBytesNoContentEncoding) { 7810 TEST_F(URLRequestTestHTTP, RawBodyBytesNoContentEncoding) {
7811 ASSERT_TRUE(http_test_server()->Start()); 7811 ASSERT_TRUE(http_test_server()->Start());
7812 7812
(...skipping 2404 matching lines...) Expand 10 before | Expand all | Expand 10 after
10217 AddTestInterceptor()->set_main_intercept_job(std::move(job)); 10217 AddTestInterceptor()->set_main_intercept_job(std::move(job));
10218 10218
10219 req->Start(); 10219 req->Start();
10220 req->Cancel(); 10220 req->Cancel();
10221 base::RunLoop().RunUntilIdle(); 10221 base::RunLoop().RunUntilIdle();
10222 EXPECT_EQ(ERR_ABORTED, d.request_status()); 10222 EXPECT_EQ(ERR_ABORTED, d.request_status());
10223 EXPECT_EQ(0, d.received_redirect_count()); 10223 EXPECT_EQ(0, d.received_redirect_count());
10224 } 10224 }
10225 10225
10226 } // namespace net 10226 } // namespace net
OLDNEW
« no previous file with comments | « net/url_request/sdch_dictionary_fetcher.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698