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

Side by Side Diff: third_party/WebKit/Source/core/fetch/CachingCorrectnessTest.cpp

Issue 2391523002: Do not revalidate when ResourceLoaderOptions.synchronousPolicy is different (Closed)
Patch Set: git cl format 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
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2014, Google Inc. All rights reserved. 2 * Copyright (c) 2014, Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 Resource* resource = Resource::create(request, type); 111 Resource* resource = Resource::create(request, type);
112 resource->setResponse(ResourceResponse(KURL(ParsedURLString, kResourceURL), 112 resource->setResponse(ResourceResponse(KURL(ParsedURLString, kResourceURL),
113 "text/html", 0, nullAtom, String())); 113 "text/html", 0, nullAtom, String()));
114 resource->finish(); 114 resource->finish();
115 memoryCache()->add(resource); 115 memoryCache()->add(resource);
116 116
117 return resource; 117 return resource;
118 } 118 }
119 119
120 Resource* fetch() { 120 Resource* fetch() {
121 FetchRequest fetchRequest( 121 ResourceRequest resourceRequest(KURL(ParsedURLString, kResourceURL));
122 ResourceRequest(KURL(ParsedURLString, kResourceURL)), 122 resourceRequest.setRequestContext(WebURLRequest::RequestContextInternal);
123 FetchInitiatorInfo()); 123 FetchRequest fetchRequest(resourceRequest, FetchInitiatorInfo());
124 return RawResource::fetchSynchronously(fetchRequest, fetcher()); 124 return RawResource::fetch(fetchRequest, fetcher());
125 } 125 }
126 126
127 Resource* fetchImage() { 127 Resource* fetchImage() {
128 FetchRequest fetchRequest( 128 FetchRequest fetchRequest(
129 ResourceRequest(KURL(ParsedURLString, kResourceURL)), 129 ResourceRequest(KURL(ParsedURLString, kResourceURL)),
130 FetchInitiatorInfo()); 130 FetchInitiatorInfo());
131 return ImageResource::fetch(fetchRequest, fetcher()); 131 return ImageResource::fetch(fetchRequest, fetcher());
132 } 132 }
133 133
134 ResourceFetcher* fetcher() const { return m_fetcher.get(); } 134 ResourceFetcher* fetcher() const { return m_fetcher.get(); }
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after
602 firstResource->finish(); 602 firstResource->finish();
603 memoryCache()->add(firstResource); 603 memoryCache()->add(firstResource);
604 604
605 advanceClock(500.); 605 advanceClock(500.);
606 606
607 Resource* fetched = fetch(); 607 Resource* fetched = fetch();
608 EXPECT_EQ(firstResource, fetched); 608 EXPECT_EQ(firstResource, fetched);
609 } 609 }
610 610
611 } // namespace blink 611 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698