OLD | NEW |
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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 } | 161 } |
162 if (preloads) { | 162 if (preloads) { |
163 if (testCase.priority == ResourceLoadPriorityUnresolved) { | 163 if (testCase.priority == ResourceLoadPriorityUnresolved) { |
164 ASSERT_EQ((unsigned)0, preloads->size()); | 164 ASSERT_EQ((unsigned)0, preloads->size()); |
165 } else { | 165 } else { |
166 ASSERT_EQ((unsigned)1, preloads->size()); | 166 ASSERT_EQ((unsigned)1, preloads->size()); |
167 if (preloads->size() > 0) { | 167 if (preloads->size() > 0) { |
168 Resource* resource = preloads->begin().get()->get(); | 168 Resource* resource = preloads->begin().get()->get(); |
169 ASSERT_EQ(testCase.priority, resource->resourceRequest().pri
ority()); | 169 ASSERT_EQ(testCase.priority, resource->resourceRequest().pri
ority()); |
170 ASSERT_EQ(testCase.context, resource->resourceRequest().requ
estContext()); | 170 ASSERT_EQ(testCase.context, resource->resourceRequest().requ
estContext()); |
171 ASSERT_STREQ(testCase.accept, resource->accept().string().as
cii().data()); | 171 ASSERT_STREQ(testCase.accept, resource->accept().getString()
.ascii().data()); |
172 } | 172 } |
173 } | 173 } |
174 dummyPageHolder->document().fetcher()->clearPreloads(); | 174 dummyPageHolder->document().fetcher()->clearPreloads(); |
175 } | 175 } |
176 memoryCache()->evictResources(); | 176 memoryCache()->evictResources(); |
177 Platform::current()->unitTestSupport()->unregisterAllMockedURLs(); | 177 Platform::current()->unitTestSupport()->unregisterAllMockedURLs(); |
178 } | 178 } |
179 } | 179 } |
180 | 180 |
181 TEST(LinkLoaderTest, DNSPrefetch) | 181 TEST(LinkLoaderTest, DNSPrefetch) |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 hrefURL, | 242 hrefURL, |
243 dummyPageHolder->document(), | 243 dummyPageHolder->document(), |
244 networkHints); | 244 networkHints); |
245 ASSERT_EQ(testCase.shouldLoad, networkHints.didPreconnect()); | 245 ASSERT_EQ(testCase.shouldLoad, networkHints.didPreconnect()); |
246 ASSERT_EQ(testCase.isHTTPS, networkHints.isHTTPS()); | 246 ASSERT_EQ(testCase.isHTTPS, networkHints.isHTTPS()); |
247 ASSERT_EQ(testCase.isCrossOrigin, networkHints.isCrossOrigin()); | 247 ASSERT_EQ(testCase.isCrossOrigin, networkHints.isCrossOrigin()); |
248 } | 248 } |
249 } | 249 } |
250 | 250 |
251 } // namespace blink | 251 } // namespace blink |
OLD | NEW |