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

Side by Side Diff: components/precache/core/precache_fetcher_unittest.cc

Issue 1481143002: Added HttpUtils::HasValidators and HttpResponse::HasValidators (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Clarified the documentation Created 4 years, 9 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 | « components/precache/core/precache_fetcher.cc ('k') | net/http/http_response_headers.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "components/precache/core/precache_fetcher.h" 5 #include "components/precache/core/precache_fetcher.h"
6 6
7 #include <set> 7 #include <set>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 loop_.RunUntilIdle(); 224 loop_.RunUntilIdle();
225 225
226 ASSERT_NE(nullptr, fetcher1); 226 ASSERT_NE(nullptr, fetcher1);
227 EXPECT_EQ(net::LOAD_ONLY_FROM_CACHE | kNoTracking, fetcher1->GetLoadFlags()); 227 EXPECT_EQ(net::LOAD_ONLY_FROM_CACHE | kNoTracking, fetcher1->GetLoadFlags());
228 ASSERT_NE(nullptr, fetcher2); 228 ASSERT_NE(nullptr, fetcher2);
229 EXPECT_EQ(net::LOAD_VALIDATE_CACHE | kNoTracking, fetcher2->GetLoadFlags()); 229 EXPECT_EQ(net::LOAD_VALIDATE_CACHE | kNoTracking, fetcher2->GetLoadFlags());
230 230
231 EXPECT_EQ(true, callback_called_); 231 EXPECT_EQ(true, callback_called_);
232 } 232 }
233 233
234 TEST_F(PrecacheFetcherFetcherTest, ResourceHasStrongValidators) { 234 TEST_F(PrecacheFetcherFetcherTest, ResourceHasValidators) {
235 GURL url(kGoodResourceURL); 235 GURL url(kGoodResourceURL);
236 236
237 net::FakeURLFetcher *fetcher1 = nullptr, *fetcher2 = nullptr; 237 net::FakeURLFetcher *fetcher1 = nullptr, *fetcher2 = nullptr;
238 EXPECT_CALL(factory_, DoCreateURLFetcher(_, url, net::URLFetcher::GET, _)) 238 EXPECT_CALL(factory_, DoCreateURLFetcher(_, url, net::URLFetcher::GET, _))
239 .WillOnce(factory_.RespondWith( 239 .WillOnce(factory_.RespondWith(
240 "", 240 "",
241 [](net::FakeURLFetcher* fetcher) { 241 [](net::FakeURLFetcher* fetcher) {
242 std::string raw_headers("HTTP/1.1 200 OK\0ETag: foo\0\0", 27); 242 std::string raw_headers("HTTP/1.1 200 OK\0ETag: foo\0\0", 27);
243 fetcher->set_response_headers( 243 fetcher->set_response_headers(
244 make_scoped_refptr(new net::HttpResponseHeaders(raw_headers))); 244 make_scoped_refptr(new net::HttpResponseHeaders(raw_headers)));
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
555 EXPECT_EQ(expected_requested_urls, url_callback_.requested_urls()); 555 EXPECT_EQ(expected_requested_urls, url_callback_.requested_urls());
556 556
557 EXPECT_TRUE(precache_delegate_.was_on_done_called()); 557 EXPECT_TRUE(precache_delegate_.was_on_done_called());
558 } 558 }
559 559
560 #endif // PRECACHE_MANIFEST_URL_PREFIX 560 #endif // PRECACHE_MANIFEST_URL_PREFIX
561 561
562 } // namespace 562 } // namespace
563 563
564 } // namespace precache 564 } // namespace precache
OLDNEW
« no previous file with comments | « components/precache/core/precache_fetcher.cc ('k') | net/http/http_response_headers.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698