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

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

Issue 643703005: Test srcset parsing for space in url (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « no previous file | 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/HTMLSrcsetParser.h" 6 #include "core/html/parser/HTMLSrcsetParser.h"
7 7
8 #include <gtest/gtest.h> 8 #include <gtest/gtest.h>
9 #include <limits.h> 9 #include <limits.h>
10 10
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 {1.0, -1, "", "inf.gif 0.00000000001x", "inf.gif", 1e-11, -1}, 96 {1.0, -1, "", "inf.gif 0.00000000001x", "inf.gif", 1e-11, -1},
97 {1.0, -1, "", "data:,a ( , data:,b 1x, ), data:,c", "data:,c", 1.0, -1}, 97 {1.0, -1, "", "data:,a ( , data:,b 1x, ), data:,c", "data:,c", 1.0, -1},
98 {1.0, 1, "", "data:,a 1w 1h", "data:,a", 1.0, 1}, 98 {1.0, 1, "", "data:,a 1w 1h", "data:,a", 1.0, 1},
99 {1.0, -1, "", ",1x.gif 1x future-descriptor(3x, 4h, whatever), 2x.gif 2x ", "2x.gif", 2.0, -1}, 99 {1.0, -1, "", ",1x.gif 1x future-descriptor(3x, 4h, whatever), 2x.gif 2x ", "2x.gif", 2.0, -1},
100 {2.0, -1, "", ",1x.gif 1x future-descriptor(3x, 4h, whatever), 2x.gif 2x ", "2x.gif", 2.0, -1}, 100 {2.0, -1, "", ",1x.gif 1x future-descriptor(3x, 4h, whatever), 2x.gif 2x ", "2x.gif", 2.0, -1},
101 {1.0, -1, "", "data:,a 1 w", "", 1.0, -1}, 101 {1.0, -1, "", "data:,a 1 w", "", 1.0, -1},
102 {1.0, -1, "", "data:,a 1 w", "", 1.0, -1}, 102 {1.0, -1, "", "data:,a 1 w", "", 1.0, -1},
103 {1.0, -1, "", "data:,a +1x", "", 1.0, -1}, 103 {1.0, -1, "", "data:,a +1x", "", 1.0, -1},
104 {1.0, -1, "", "data:,a +1x", "", 1.0, -1}, 104 {1.0, -1, "", "data:,a +1x", "", 1.0, -1},
105 {1.0, -1, "", "data:,a 1.0x", "data:,a", 1.0, -1}, 105 {1.0, -1, "", "data:,a 1.0x", "data:,a", 1.0, -1},
106 {1.0, -1, "", "1%20and%202.gif 1x", "1%20and%202.gif", 1.0, -1},
106 {0, 0, 0, 0, 0, 0} // Do not remove the terminator line. 107 {0, 0, 0, 0, 0, 0} // Do not remove the terminator line.
107 }; 108 };
108 109
109 for (unsigned i = 0; testCases[i].srcInput; ++i) { 110 for (unsigned i = 0; testCases[i].srcInput; ++i) {
110 TestCase test = testCases[i]; 111 TestCase test = testCases[i];
111 ImageCandidate candidate = bestFitSourceForImageAttributes(test.deviceSc aleFactor, test.effectiveSize, test.srcInput, test.srcsetInput); 112 ImageCandidate candidate = bestFitSourceForImageAttributes(test.deviceSc aleFactor, test.effectiveSize, test.srcInput, test.srcsetInput);
112 ASSERT_EQ(test.outputDensity, candidate.density()); 113 ASSERT_EQ(test.outputDensity, candidate.density());
113 ASSERT_EQ(test.outputResourceWidth, candidate.resourceWidth()); 114 ASSERT_EQ(test.outputResourceWidth, candidate.resourceWidth());
114 ASSERT_STREQ(test.outputURL, candidate.toString().ascii().data()); 115 ASSERT_STREQ(test.outputURL, candidate.toString().ascii().data());
115 } 116 }
116 } 117 }
117 118
118 } // namespace 119 } // namespace
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698