OLD | NEW |
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 "core/html/parser/HTMLSrcsetParser.h" | 5 #include "core/html/parser/HTMLSrcsetParser.h" |
6 | 6 |
| 7 #include <limits.h> |
7 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
8 #include <limits.h> | |
9 | 9 |
10 namespace blink { | 10 namespace blink { |
11 | 11 |
12 typedef struct { | 12 typedef struct { |
13 float device_scale_factor; | 13 float device_scale_factor; |
14 float effective_size; | 14 float effective_size; |
15 const char* src_input; | 15 const char* src_input; |
16 const char* srcset_input; | 16 const char* srcset_input; |
17 const char* output_url; | 17 const char* output_url; |
18 float output_density; | 18 float output_density; |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 ImageCandidate candidate = BestFitSourceForImageAttributes( | 166 ImageCandidate candidate = BestFitSourceForImageAttributes( |
167 test.device_scale_factor, test.effective_size, test.src_input, | 167 test.device_scale_factor, test.effective_size, test.src_input, |
168 test.srcset_input); | 168 test.srcset_input); |
169 ASSERT_EQ(test.output_density, candidate.Density()); | 169 ASSERT_EQ(test.output_density, candidate.Density()); |
170 ASSERT_EQ(test.output_resource_width, candidate.GetResourceWidth()); | 170 ASSERT_EQ(test.output_resource_width, candidate.GetResourceWidth()); |
171 ASSERT_STREQ(test.output_url, candidate.ToString().Ascii().data()); | 171 ASSERT_STREQ(test.output_url, candidate.ToString().Ascii().data()); |
172 } | 172 } |
173 } | 173 } |
174 | 174 |
175 } // namespace blink | 175 } // namespace blink |
OLD | NEW |