OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/common/web_apps.h" | 5 #include "chrome/common/web_apps.h" |
6 | 6 |
7 #include "base/file_path.h" | 7 #include "base/file_path.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "base/scoped_ptr.h" | 10 #include "base/scoped_ptr.h" |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 }; | 171 }; |
172 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(data); ++i) { | 172 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(data); ++i) { |
173 bool is_any; | 173 bool is_any; |
174 std::vector<gfx::Size> sizes; | 174 std::vector<gfx::Size> sizes; |
175 bool result = web_apps::ParseIconSizes(ASCIIToUTF16(data[i].input), &sizes, | 175 bool result = web_apps::ParseIconSizes(ASCIIToUTF16(data[i].input), &sizes, |
176 &is_any); | 176 &is_any); |
177 ASSERT_EQ(result, data[i].expected_result); | 177 ASSERT_EQ(result, data[i].expected_result); |
178 if (result) { | 178 if (result) { |
179 ASSERT_EQ(data[i].is_any, is_any); | 179 ASSERT_EQ(data[i].is_any, is_any); |
180 ASSERT_EQ(data[i].expected_size_count, sizes.size()); | 180 ASSERT_EQ(data[i].expected_size_count, sizes.size()); |
181 if (sizes.size() > 0) { | 181 if (!sizes.empty()) { |
182 ASSERT_EQ(data[i].width1, sizes[0].width()); | 182 ASSERT_EQ(data[i].width1, sizes[0].width()); |
183 ASSERT_EQ(data[i].height1, sizes[0].height()); | 183 ASSERT_EQ(data[i].height1, sizes[0].height()); |
184 } | 184 } |
185 if (sizes.size() > 1) { | 185 if (sizes.size() > 1) { |
186 ASSERT_EQ(data[i].width2, sizes[1].width()); | 186 ASSERT_EQ(data[i].width2, sizes[1].width()); |
187 ASSERT_EQ(data[i].height2, sizes[1].height()); | 187 ASSERT_EQ(data[i].height2, sizes[1].height()); |
188 } | 188 } |
189 } | 189 } |
190 } | 190 } |
191 } | 191 } |
OLD | NEW |