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

Unified Diff: Source/core/html/parser/HTMLSrcsetParserTest.cpp

Issue 355953003: Fixed srcset descriptor parsing bug and added tests (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/html/parser/HTMLSrcsetParser.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/parser/HTMLSrcsetParserTest.cpp
diff --git a/Source/core/html/parser/HTMLSrcsetParserTest.cpp b/Source/core/html/parser/HTMLSrcsetParserTest.cpp
index 76236102f90d97eab2a2c81bc02716c0c448f8d9..8959a3b0ee36443deeaa9a44191f0d9d41ae8250 100644
--- a/Source/core/html/parser/HTMLSrcsetParserTest.cpp
+++ b/Source/core/html/parser/HTMLSrcsetParserTest.cpp
@@ -52,6 +52,10 @@ TEST(HTMLSrcsetParserTest, Basic)
{1.0, -1, "src.gif", "1x.gif 1x, 2x.gif 2x", "1x.gif", 1.0, -1},
{1.0, -1, "src.gif", "2x.gif 2x", "src.gif", 1.0, -1},
{2.0, -1, "src.gif", "2x.gif 2x", "2x.gif", 2.0, -1},
+ {2.0, -1, "src.gif", "2x.gif 2px", "src.gif", 1.0, -1},
+ {2.0, -1, "src.gif", "2x.gif 2ex", "src.gif", 1.0, -1},
+ {2.0, -1, "src.gif", "2x.gif 2e1x", "2x.gif", 20.0, -1},
+ {2.0, -1, "src.gif", "2x.gif +2x", "2x.gif", 2.0, -1},
{1.5, -1, "src.gif", "2x.gif 2x", "2x.gif", 2.0, -1},
{2.5, -1, "src.gif", "2x.gif 2x", "2x.gif", 2.0, -1},
{2.5, -1, "src.gif", "2x.gif 2x, 3x.gif 3x", "3x.gif", 3.0, -1},
@@ -69,9 +73,12 @@ TEST(HTMLSrcsetParserTest, Basic)
{5.0, -1, "", "1x,, , x ,2x , 1x.gif, 3x, 4x.gif 4x 100z, 5x.gif 5, dx.gif dx, 2x.gif 2x ,", "4x.gif", 4.0, -1},
{2.0, -1, "", "1x.gif 1x, data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMDAiIGhlaWdodD0iMTAwIj4KCTxyZWN0IHdpZHRoPSIxMDAiIGhlaWdodD0iMTAwIiBmaWxsPSJncmVlbiIvPgo8L3N2Zz4K 2x", "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMDAiIGhlaWdodD0iMTAwIj4KCTxyZWN0IHdpZHRoPSIxMDAiIGhlaWdodD0iMTAwIiBmaWxsPSJncmVlbiIvPgo8L3N2Zz4K", 2.0, -1 },
{2.0, -1, "1x.gif", "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMDAiIGhlaWdodD0iMTAwIj4KCTxyZWN0IHdpZHRoPSIxMDAiIGhlaWdodD0iMTAwIiBmaWxsPSJncmVlbiIvPgo8L3N2Zz4K 2x", "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMDAiIGhlaWdodD0iMTAwIj4KCTxyZWN0IHdpZHRoPSIxMDAiIGhlaWdodD0iMTAwIiBmaWxsPSJncmVlbiIvPgo8L3N2Zz4K", 2.0, -1 },
- {2.0, -1, "1x.svg#red", "1x.svg#green 2x", "1x.svg#green", 2.0, -1 },
- {2.0, -1, "", "1x.svg#red 1x, 1x.svg#green 2x", "1x.svg#green", 2.0, -1 },
+ {2.0, -1, "1x.svg#red", "1x.svg#green 2x", "1x.svg#green", 2.0, -1},
+ {2.0, -1, "", "1x.svg#red 1x, 1x.svg#green 2x", "1x.svg#green", 2.0, -1},
{1.0, 400, "", "400.gif 400w, 6000.gif 6000w", "400.gif", 1.0, 400},
+ {1.0, 400, "", "400.gif 400pw, 6000.gif 6000w", "6000.gif", 15.0, 6000},
+ {1.0, 400, "fallback.gif", "400.gif 400pw", "fallback.gif", 1.0, -1},
+ {1.0, 400, "fallback.gif", "400.gif +400w", "400.gif", 1.0, 400},
{1.0, 400, "", "400.gif 400w 400h, 6000.gif 6000w", "400.gif", 1.0, 400},
{2.0, 400, "", "400.gif 400w, 6000.gif 6000w", "6000.gif", 15.0, 6000},
{1.0, 400, "src.gif", "800.gif 800w", "800.gif", 2.0, 800},
« no previous file with comments | « Source/core/html/parser/HTMLSrcsetParser.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698