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

Side by Side Diff: Source/core/html/parser/HTMLPreloadScannerTest.cpp

Issue 1220443004: Revert of Revert of Fix CH Width header when preloadScanner and <picture> are involved (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 5 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
« no previous file with comments | « Source/core/html/parser/HTMLPreloadScanner.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "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 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 runSetUp(ViewportEnabled, PreloadDisabled); 285 runSetUp(ViewportEnabled, PreloadDisabled);
286 286
287 TestCase testCases[] = { 287 TestCase testCases[] = {
288 {"http://example.test", "<img src='bla.gif'>"}, 288 {"http://example.test", "<img src='bla.gif'>"},
289 }; 289 };
290 290
291 for (const auto& testCase : testCases) 291 for (const auto& testCase : testCases)
292 test(testCase); 292 test(testCase);
293 } 293 }
294 294
295 TEST_F(HTMLPreloadScannerTest, testPicture)
296 {
297 TestCase testCases[] = {
298 {"http://example.test", "<picture><source srcset='srcset_bla.gif'><img s rc='bla.gif'></picture>", "srcset_bla.gif", "http://example.test/", Resource::Im age, 0},
299 {"http://example.test", "<picture><source sizes='50vw' srcset='srcset_bl a.gif'><img src='bla.gif'></picture>", "srcset_bla.gif", "http://example.test/", Resource::Image, 250},
300 {"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},
301 {"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},
302 {"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},
303 };
304
305 for (const auto& testCase : testCases)
306 test(testCase);
307 }
308
295 } // namespace blink 309 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/html/parser/HTMLPreloadScanner.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698