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 "public/platform/WebIconSizesParser.h" | 5 #include "public/platform/WebIconSizesParser.h" |
6 | 6 |
7 #include "platform/wtf/text/AtomicString.h" | 7 #include "platform/wtf/text/AtomicString.h" |
8 #include "public/platform/WebSize.h" | 8 #include "public/platform/WebSize.h" |
9 #include "public/platform/WebString.h" | 9 #include "public/platform/WebString.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
11 | 11 |
12 namespace blink { | 12 namespace blink { |
13 | 13 |
14 class WebIconSizesParserTest : public testing::Test {}; | 14 class WebIconSizesParserTest : public ::testing::Test {}; |
15 | 15 |
16 TEST(WebIconSizesParserTest, parseSizes) { | 16 TEST(WebIconSizesParserTest, parseSizes) { |
17 WebString sizes_attribute = "32x33"; | 17 WebString sizes_attribute = "32x33"; |
18 WebVector<WebSize> sizes; | 18 WebVector<WebSize> sizes; |
19 sizes = WebIconSizesParser::ParseIconSizes(sizes_attribute); | 19 sizes = WebIconSizesParser::ParseIconSizes(sizes_attribute); |
20 ASSERT_EQ(1U, sizes.size()); | 20 ASSERT_EQ(1U, sizes.size()); |
21 EXPECT_EQ(32, sizes[0].width); | 21 EXPECT_EQ(32, sizes[0].width); |
22 EXPECT_EQ(33, sizes[0].height); | 22 EXPECT_EQ(33, sizes[0].height); |
23 | 23 |
24 sizes_attribute = "0x33"; | 24 sizes_attribute = "0x33"; |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 EXPECT_EQ(0, sizes[1].height); | 91 EXPECT_EQ(0, sizes[1].height); |
92 | 92 |
93 sizes_attribute = "32x33, 64x64"; | 93 sizes_attribute = "32x33, 64x64"; |
94 sizes = WebIconSizesParser::ParseIconSizes(sizes_attribute); | 94 sizes = WebIconSizesParser::ParseIconSizes(sizes_attribute); |
95 ASSERT_EQ(1U, sizes.size()); | 95 ASSERT_EQ(1U, sizes.size()); |
96 EXPECT_EQ(64, sizes[0].width); | 96 EXPECT_EQ(64, sizes[0].width); |
97 EXPECT_EQ(64, sizes[0].height); | 97 EXPECT_EQ(64, sizes[0].height); |
98 } | 98 } |
99 | 99 |
100 } // namespace blink | 100 } // namespace blink |
OLD | NEW |