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 "config.h" | 5 #include "config.h" |
6 #include "core/html/parser/HTMLPreloadScanner.h" | 6 #include "core/html/parser/HTMLPreloadScanner.h" |
7 | 7 |
8 #include "core/MediaTypeNames.h" | 8 #include "core/MediaTypeNames.h" |
9 #include "core/css/MediaValuesCached.h" | 9 #include "core/css/MediaValuesCached.h" |
10 #include "core/fetch/ClientHintsPreferences.h" | 10 #include "core/fetch/ClientHintsPreferences.h" |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 enum PreloadState { | 82 enum PreloadState { |
83 PreloadEnabled, | 83 PreloadEnabled, |
84 PreloadDisabled, | 84 PreloadDisabled, |
85 }; | 85 }; |
86 | 86 |
87 HTMLPreloadScannerTest() | 87 HTMLPreloadScannerTest() |
88 : m_dummyPageHolder(DummyPageHolder::create()) | 88 : m_dummyPageHolder(DummyPageHolder::create()) |
89 { | 89 { |
90 } | 90 } |
91 | 91 |
92 PassRefPtr<MediaValues> createMediaValues() | 92 PassRefPtrWillBeRawPtr<MediaValues> createMediaValues() |
93 { | 93 { |
94 MediaValuesCached::MediaValuesCachedData data; | 94 MediaValuesCached::MediaValuesCachedData data; |
95 data.viewportWidth = 500; | 95 data.viewportWidth = 500; |
96 data.viewportHeight = 600; | 96 data.viewportHeight = 600; |
97 data.deviceWidth = 500; | 97 data.deviceWidth = 500; |
98 data.deviceHeight = 500; | 98 data.deviceHeight = 500; |
99 data.devicePixelRatio = 2.0; | 99 data.devicePixelRatio = 2.0; |
100 data.colorBitsPerComponent = 24; | 100 data.colorBitsPerComponent = 24; |
101 data.monochromeBitsPerComponent = 0; | 101 data.monochromeBitsPerComponent = 0; |
102 data.primaryPointerType = PointerTypeFine; | 102 data.primaryPointerType = PointerTypeFine; |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 {"http://example.test", "<picture><source sizes='50vw' srcset='srcset_bl
a.gif'><img sizes='50w' src='bla.gif'></picture>", "srcset_bla.gif", "http://exa
mple.test/", Resource::Image, 250}, | 291 {"http://example.test", "<picture><source sizes='50vw' srcset='srcset_bl
a.gif'><img sizes='50w' src='bla.gif'></picture>", "srcset_bla.gif", "http://exa
mple.test/", Resource::Image, 250}, |
292 {"http://example.test", "<picture><source srcset='srcset_bla.gif' sizes=
'50vw'><img sizes='50w' src='bla.gif'></picture>", "srcset_bla.gif", "http://exa
mple.test/", Resource::Image, 250}, | 292 {"http://example.test", "<picture><source srcset='srcset_bla.gif' sizes=
'50vw'><img sizes='50w' src='bla.gif'></picture>", "srcset_bla.gif", "http://exa
mple.test/", Resource::Image, 250}, |
293 {"http://example.test", "<picture><source srcset='srcset_bla.gif'><img s
izes='50w' src='bla.gif'></picture>", "srcset_bla.gif", "http://example.test/",
Resource::Image, 0}, | 293 {"http://example.test", "<picture><source srcset='srcset_bla.gif'><img s
izes='50w' src='bla.gif'></picture>", "srcset_bla.gif", "http://example.test/",
Resource::Image, 0}, |
294 }; | 294 }; |
295 | 295 |
296 for (const auto& testCase : testCases) | 296 for (const auto& testCase : testCases) |
297 test(testCase); | 297 test(testCase); |
298 } | 298 } |
299 | 299 |
300 } // namespace blink | 300 } // namespace blink |
OLD | NEW |