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

Side by Side Diff: third_party/WebKit/Source/core/loader/LinkLoaderTest.cpp

Issue 1667843003: Make Resource RefCountedWillBeGarbageCollectedFinalized, attempt #2 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase + address review comments Created 4 years, 10 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 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "core/loader/LinkLoader.h" 5 #include "core/loader/LinkLoader.h"
6 6
7 #include "core/fetch/MemoryCache.h" 7 #include "core/fetch/MemoryCache.h"
8 #include "core/fetch/ResourceFetcher.h" 8 #include "core/fetch/ResourceFetcher.h"
9 #include "core/frame/Settings.h" 9 #include "core/frame/Settings.h"
10 #include "core/html/LinkRelAttribute.h" 10 #include "core/html/LinkRelAttribute.h"
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 OwnPtrWillBeRawPtr<LinkLoader> loader = LinkLoader::create(loaderClient. get()); 114 OwnPtrWillBeRawPtr<LinkLoader> loader = LinkLoader::create(loaderClient. get());
115 KURL hrefURL = KURL(KURL(), testCase.href); 115 KURL hrefURL = KURL(KURL(), testCase.href);
116 loader->loadLink(LinkRelAttribute("preload"), 116 loader->loadLink(LinkRelAttribute("preload"),
117 CrossOriginAttributeNotSet, 117 CrossOriginAttributeNotSet,
118 String(), 118 String(),
119 testCase.as, 119 testCase.as,
120 hrefURL, 120 hrefURL,
121 dummyPageHolder->document(), 121 dummyPageHolder->document(),
122 NetworkHintsMock()); 122 NetworkHintsMock());
123 ASSERT(dummyPageHolder->document().fetcher()); 123 ASSERT(dummyPageHolder->document().fetcher());
124 WillBeHeapListHashSet<RawPtrWillBeMember<Resource>>* preloads = dummyPag eHolder->document().fetcher()->preloads(); 124 WillBeHeapListHashSet<RefPtrWillBeMember<Resource>>* preloads = dummyPag eHolder->document().fetcher()->preloads();
125 if (testCase.shouldLoad) 125 if (testCase.shouldLoad)
126 ASSERT_NE(nullptr, preloads); 126 ASSERT_NE(nullptr, preloads);
127 if (preloads) { 127 if (preloads) {
128 if (testCase.priority == ResourceLoadPriorityUnresolved) { 128 if (testCase.priority == ResourceLoadPriorityUnresolved) {
129 ASSERT_EQ((unsigned)0, preloads->size()); 129 ASSERT_EQ((unsigned)0, preloads->size());
130 } else { 130 } else {
131 ASSERT_EQ((unsigned)1, preloads->size()); 131 ASSERT_EQ((unsigned)1, preloads->size());
132 if (preloads->size() > 0) { 132 if (preloads->size() > 0) {
133 Resource* resource = preloads->begin().get()->get(); 133 Resource* resource = preloads->begin().get()->get();
134 ASSERT_EQ(testCase.priority, resource->resourceRequest().pri ority()); 134 ASSERT_EQ(testCase.priority, resource->resourceRequest().pri ority());
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 hrefURL, 204 hrefURL,
205 dummyPageHolder->document(), 205 dummyPageHolder->document(),
206 networkHints); 206 networkHints);
207 ASSERT_EQ(testCase.shouldLoad, networkHints.didPreconnect()); 207 ASSERT_EQ(testCase.shouldLoad, networkHints.didPreconnect());
208 ASSERT_EQ(testCase.isHTTPS, networkHints.isHTTPS()); 208 ASSERT_EQ(testCase.isHTTPS, networkHints.isHTTPS());
209 ASSERT_EQ(testCase.isCrossOrigin, networkHints.isCrossOrigin()); 209 ASSERT_EQ(testCase.isCrossOrigin, networkHints.isCrossOrigin());
210 } 210 }
211 } 211 }
212 212
213 } // namespace blink 213 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/loader/LinkLoader.cpp ('k') | third_party/WebKit/Source/core/paint/PaintLayerFilterInfo.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698