OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/favicon/fallback_icon_url_parser.h" | 5 #include "chrome/common/favicon/fallback_icon_url_parser.h" |
6 | 6 |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "components/favicon_base/fallback_icon_style.h" | 8 #include "components/favicon_base/fallback_icon_style.h" |
9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
10 #include "third_party/skia/include/core/SkColor.h" | 10 #include "third_party/skia/include/core/SkColor.h" |
11 #include "ui/gfx/favicon_size.h" | 11 #include "ui/gfx/favicon_size.h" |
12 #include "url/gurl.h" | 12 #include "url/gurl.h" |
13 | 13 |
14 using chrome::ParsedFallbackIconPath; | 14 using chrome::ParsedFallbackIconPath; |
15 using favicon_base::FallbackIconStyle; | 15 using favicon_base::FallbackIconStyle; |
16 | 16 |
17 namespace chrome { | 17 namespace chrome { |
18 | 18 |
19 namespace { | 19 namespace { |
20 | 20 |
21 // Default values for FallbackIconStyle, from | 21 // Default values for FallbackIconStyle, from |
22 // /components/favicon_base/fallback_icon_style.h | 22 // /components/favicon_base/fallback_icon_style.h |
23 SkColor kDefaultBackgroundColor = SkColorSetRGB(0x80, 0x80, 0x80); | 23 const SkColor kDefaultBackgroundColor = SkColorSetRGB(0x78, 0x78, 0x78); |
24 SkColor kDefaultTextColorDark = SK_ColorBLACK; | 24 const SkColor kDefaultTextColorDark = SK_ColorBLACK; |
25 SkColor kDefaultTextColorLight = SK_ColorWHITE; | 25 const SkColor kDefaultTextColorLight = SK_ColorWHITE; |
26 double kDefaultFontSizeRatio = 0.8; | 26 const double kDefaultFontSizeRatio = 0.44; |
27 double kDefaultRoundness = 0.125; // 1 / 8. | 27 const double kDefaultRoundness = 0; |
28 | 28 |
29 const char kTestUrlStr[] = "https://www.google.ca/imghp?hl=en&tab=wi"; | 29 const char kTestUrlStr[] = "https://www.google.ca/imghp?hl=en&tab=wi"; |
30 | 30 |
31 } // namespace | 31 } // namespace |
32 | 32 |
33 class FallbackIconUrlParserTest : public testing::Test { | 33 class FallbackIconUrlParserTest : public testing::Test { |
34 public: | 34 public: |
35 FallbackIconUrlParserTest() { | 35 FallbackIconUrlParserTest() { |
36 } | 36 } |
37 | 37 |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 // Bad specs. | 274 // Bad specs. |
275 "32,#junk,fff,0.75,0.25/http://www.google.com/", | 275 "32,#junk,fff,0.75,0.25/http://www.google.com/", |
276 }; | 276 }; |
277 for (size_t i = 0; i < arraysize(test_cases); ++i) { | 277 for (size_t i = 0; i < arraysize(test_cases); ++i) { |
278 chrome::ParsedFallbackIconPath parsed; | 278 chrome::ParsedFallbackIconPath parsed; |
279 EXPECT_FALSE(parsed.Parse(test_cases[i])) << "test_cases[" << i << "]"; | 279 EXPECT_FALSE(parsed.Parse(test_cases[i])) << "test_cases[" << i << "]"; |
280 } | 280 } |
281 } | 281 } |
282 | 282 |
283 } // namespace chrome | 283 } // namespace chrome |
OLD | NEW |