OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "components/favicon_base/favicon_url_parser.h" | 5 #include "components/favicon_base/favicon_url_parser.h" |
6 | 6 |
| 7 #include "base/macros.h" |
7 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
8 #include "components/favicon_base/favicon_types.h" | 9 #include "components/favicon_base/favicon_types.h" |
9 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
10 #include "ui/base/layout.h" | 11 #include "ui/base/layout.h" |
11 | 12 |
12 class FaviconUrlParserTest : public testing::Test { | 13 class FaviconUrlParserTest : public testing::Test { |
13 public: | 14 public: |
14 FaviconUrlParserTest() { | 15 FaviconUrlParserTest() { |
15 // Set the supported scale factors because the supported scale factors | 16 // Set the supported scale factors because the supported scale factors |
16 // affect the result of ParsePathAndScale(). | 17 // affect the result of ParsePathAndScale(). |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 EXPECT_EQ(32, parsed.size_in_dip); | 157 EXPECT_EQ(32, parsed.size_in_dip); |
157 EXPECT_EQ(1.4f, parsed.device_scale_factor); | 158 EXPECT_EQ(1.4f, parsed.device_scale_factor); |
158 | 159 |
159 const std::string path14 = | 160 const std::string path14 = |
160 "largest/iconurl/http://www.google.com/favicon.ico"; | 161 "largest/iconurl/http://www.google.com/favicon.ico"; |
161 EXPECT_TRUE(chrome::ParseFaviconPath(path14, icon_types, &parsed)); | 162 EXPECT_TRUE(chrome::ParseFaviconPath(path14, icon_types, &parsed)); |
162 EXPECT_TRUE(parsed.is_icon_url); | 163 EXPECT_TRUE(parsed.is_icon_url); |
163 EXPECT_EQ("http://www.google.com/favicon.ico", parsed.url); | 164 EXPECT_EQ("http://www.google.com/favicon.ico", parsed.url); |
164 EXPECT_EQ(0, parsed.size_in_dip); | 165 EXPECT_EQ(0, parsed.size_in_dip); |
165 } | 166 } |
OLD | NEW |