| 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 707 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 718 "bla", "http://example.test/", Resource::Image, 0}, | 718 "bla", "http://example.test/", Resource::Image, 0}, |
| 719 {"http://example.test", | 719 {"http://example.test", |
| 720 "<link rel=preload href=bla as=image media=\"(max-width: 400px)\">", | 720 "<link rel=preload href=bla as=image media=\"(max-width: 400px)\">", |
| 721 nullptr, "http://example.test/", Resource::Image, 0}, | 721 nullptr, "http://example.test/", Resource::Image, 0}, |
| 722 }; | 722 }; |
| 723 | 723 |
| 724 for (const auto& testCase : testCases) | 724 for (const auto& testCase : testCases) |
| 725 test(testCase); | 725 test(testCase); |
| 726 } | 726 } |
| 727 | 727 |
| 728 TEST_F(HTMLPreloadScannerTest, testNoDataUrls) { |
| 729 TestCase testCases[] = { |
| 730 {"http://example.test", |
| 731 "<link rel=preload href='data:text/html,<p>data</data>'>", nullptr, |
| 732 "http://example.test/", Resource::Raw, 0}, |
| 733 {"http://example.test", "<img src='data:text/html,<p>data</data>'>", |
| 734 nullptr, "http://example.test/", Resource::Image, 0}, |
| 735 {"data:text/html,<a>anchor</a>", "<img src='#anchor'>", nullptr, |
| 736 "http://example.test/", Resource::Image, 0}, |
| 737 }; |
| 738 |
| 739 for (const auto& testCase : testCases) |
| 740 test(testCase); |
| 741 } |
| 742 |
| 728 } // namespace blink | 743 } // namespace blink |
| OLD | NEW |