| 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/html/parser/HTMLPreloadScanner.h" | 5 #include "core/html/parser/HTMLPreloadScanner.h" |
| 6 | 6 |
| 7 #include "core/MediaTypeNames.h" | 7 #include "core/MediaTypeNames.h" |
| 8 #include "core/css/MediaValuesCached.h" | 8 #include "core/css/MediaValuesCached.h" |
| 9 #include "core/fetch/ClientHintsPreferences.h" | 9 #include "core/fetch/ClientHintsPreferences.h" |
| 10 #include "core/frame/Settings.h" | 10 #include "core/frame/Settings.h" |
| (...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 { "http://example.test", "<img src='bla.gif'/>", "bla.gif", "http://exam
ple.test/", Resource::Image, 0, ReferrerPolicyNever } | 358 { "http://example.test", "<img src='bla.gif'/>", "bla.gif", "http://exam
ple.test/", Resource::Image, 0, ReferrerPolicyNever } |
| 359 }; | 359 }; |
| 360 | 360 |
| 361 for (const auto& testCase : testCases) | 361 for (const auto& testCase : testCases) |
| 362 test(testCase); | 362 test(testCase); |
| 363 } | 363 } |
| 364 | 364 |
| 365 TEST_F(HTMLPreloadScannerTest, testLinkRelPreload) | 365 TEST_F(HTMLPreloadScannerTest, testLinkRelPreload) |
| 366 { | 366 { |
| 367 TestCase testCases[] = { | 367 TestCase testCases[] = { |
| 368 {"http://example.test", "<link rel=preload href=bla>", "bla", "http://ex
ample.test/", Resource::LinkSubresource, 0}, | 368 {"http://example.test", "<link rel=preload href=bla>", "bla", "http://ex
ample.test/", Resource::LinkPreload, 0}, |
| 369 {"http://example.test", "<link rel=preload href=bla as=script>", "bla",
"http://example.test/", Resource::Script, 0}, | 369 {"http://example.test", "<link rel=preload href=bla as=script>", "bla",
"http://example.test/", Resource::Script, 0}, |
| 370 {"http://example.test", "<link rel=preload href=bla as=style>", "bla", "
http://example.test/", Resource::CSSStyleSheet, 0}, | 370 {"http://example.test", "<link rel=preload href=bla as=style>", "bla", "
http://example.test/", Resource::CSSStyleSheet, 0}, |
| 371 {"http://example.test", "<link rel=preload href=bla as=image>", "bla", "
http://example.test/", Resource::Image, 0}, | 371 {"http://example.test", "<link rel=preload href=bla as=image>", "bla", "
http://example.test/", Resource::Image, 0}, |
| 372 {"http://example.test", "<link rel=preload href=bla as=font>", "bla", "h
ttp://example.test/", Resource::Font, 0}, | 372 {"http://example.test", "<link rel=preload href=bla as=font>", "bla", "h
ttp://example.test/", Resource::Font, 0}, |
| 373 {"http://example.test", "<link rel=preload href=bla as=audio>", "bla", "
http://example.test/", Resource::Media, 0}, | 373 {"http://example.test", "<link rel=preload href=bla as=audio>", "bla", "
http://example.test/", Resource::Media, 0}, |
| 374 {"http://example.test", "<link rel=preload href=bla as=video>", "bla", "
http://example.test/", Resource::Media, 0}, | 374 {"http://example.test", "<link rel=preload href=bla as=video>", "bla", "
http://example.test/", Resource::Media, 0}, |
| 375 {"http://example.test", "<link rel=preload href=bla as=track>", "bla", "
http://example.test/", Resource::TextTrack, 0}, | 375 {"http://example.test", "<link rel=preload href=bla as=track>", "bla", "
http://example.test/", Resource::TextTrack, 0}, |
| 376 }; | 376 }; |
| 377 | 377 |
| 378 for (const auto& testCase : testCases) | 378 for (const auto& testCase : testCases) |
| 379 test(testCase); | 379 test(testCase); |
| 380 } | 380 } |
| 381 | 381 |
| 382 } // namespace blink | 382 } // namespace blink |
| OLD | NEW |