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

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

Issue 667763004: Srcset resource selection use a geometric mean to determine resource. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Review nits Created 6 years, 2 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 745d26ed48e54920e4d5394289d86f6e8d0dac8a..e9bb5b573da3b8c813c3633da6e3100db0a541a9 100644
--- a/Source/core/html/parser/HTMLSrcsetParserTest.cpp
+++ b/Source/core/html/parser/HTMLSrcsetParserTest.cpp
@@ -56,7 +56,8 @@ TEST(HTMLSrcsetParserTest, Basic)
{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},
+ {10.0, -1, "src.gif", "2x.gif 2e1x", "2x.gif", 20.0, -1},
+ {2.0, -1, "src.gif", "2x.gif 2e1x", "src.gif", 1.0, -1},
{2.0, -1, "src.gif", "2x.gif +2x", "src.gif", 1.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},
@@ -82,7 +83,12 @@ TEST(HTMLSrcsetParserTest, Basic)
{1.0, 400, "fallback.gif", "400.gif 400pw", "fallback.gif", 1.0, -1},
{1.0, 400, "fallback.gif", "400.gif +400w", "fallback.gif", 1.0, -1},
{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},
+ {4.0, 400, "", "400.gif 400w, 6000.gif 6000w", "6000.gif", 15.0, 6000},
+ {3.8, 400, "", "400.gif 400w, 6000.gif 6000w", "400.gif", 1.0, 400},
+ {0.9, 800, "src.gif", "400.gif 400w", "400.gif", 0.5, 400},
+ {0.9, 800, "src.gif", "1x.gif 1x, 400.gif 400w", "1x.gif", 1.0, -1},
+ {0.9, 800, "src.gif", "1x.gif 0.6x, 400.gif 400w", "1x.gif", 0.6, -1},
+ {2.0, 800, "src.gif", "400.gif 400w", "400.gif", 0.5, 400},
{1.0, 400, "src.gif", "800.gif 800w", "800.gif", 2.0, 800},
{1.0, 400, "src.gif", "0.gif 0w, 800.gif 800w", "800.gif", 2.0, 800},
{1.0, 400, "src.gif", "0.gif 0w, 2x.gif 2x", "src.gif", 1.0, -1},
@@ -104,6 +110,7 @@ TEST(HTMLSrcsetParserTest, Basic)
{1.0, -1, "", "data:,a +1x", "", 1.0, -1},
{1.0, -1, "", "data:,a 1.0x", "data:,a", 1.0, -1},
{1.0, -1, "", "1%20and%202.gif 1x", "1%20and%202.gif", 1.0, -1},
+ {1.0, 700, "", "data:,a 0.5x, data:,b 1400w", "data:,b", 2.0, 1400},
{0, 0, 0, 0, 0, 0} // Do not remove the terminator line.
};
« 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