OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/extensions/extension_icon_set.h" | 5 #include "chrome/common/extensions/extension_icon_set.h" |
6 | 6 |
7 #include "chrome/common/extensions/extension_constants.h" | 7 #include "chrome/common/extensions/extension_constants.h" |
8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
9 | 9 |
10 namespace { | 10 namespace { |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 TEST(ExtensionIconSet, Values) { | 55 TEST(ExtensionIconSet, Values) { |
56 ExtensionIconSet icons; | 56 ExtensionIconSet icons; |
57 EXPECT_FALSE(icons.ContainsPath("foo")); | 57 EXPECT_FALSE(icons.ContainsPath("foo")); |
58 | 58 |
59 icons.Add(extension_misc::EXTENSION_ICON_BITTY, "foo"); | 59 icons.Add(extension_misc::EXTENSION_ICON_BITTY, "foo"); |
60 icons.Add(extension_misc::EXTENSION_ICON_GIGANTOR, "bar"); | 60 icons.Add(extension_misc::EXTENSION_ICON_GIGANTOR, "bar"); |
61 | 61 |
62 EXPECT_TRUE(icons.ContainsPath("foo")); | 62 EXPECT_TRUE(icons.ContainsPath("foo")); |
63 EXPECT_TRUE(icons.ContainsPath("bar")); | 63 EXPECT_TRUE(icons.ContainsPath("bar")); |
64 EXPECT_FALSE(icons.ContainsPath("baz")); | 64 EXPECT_FALSE(icons.ContainsPath("baz")); |
65 EXPECT_FALSE(icons.ContainsPath("")); | 65 EXPECT_FALSE(icons.ContainsPath(std::string())); |
66 | 66 |
67 icons.Clear(); | 67 icons.Clear(); |
68 EXPECT_FALSE(icons.ContainsPath("foo")); | 68 EXPECT_FALSE(icons.ContainsPath("foo")); |
69 } | 69 } |
70 | 70 |
71 TEST(ExtensionIconSet, FindSize) { | 71 TEST(ExtensionIconSet, FindSize) { |
72 ExtensionIconSet icons; | 72 ExtensionIconSet icons; |
73 EXPECT_EQ(extension_misc::EXTENSION_ICON_INVALID, | 73 EXPECT_EQ(extension_misc::EXTENSION_ICON_INVALID, |
74 icons.GetIconSizeFromPath("foo")); | 74 icons.GetIconSizeFromPath("foo")); |
75 | 75 |
76 icons.Add(extension_misc::EXTENSION_ICON_BITTY, "foo"); | 76 icons.Add(extension_misc::EXTENSION_ICON_BITTY, "foo"); |
77 icons.Add(extension_misc::EXTENSION_ICON_GIGANTOR, "bar"); | 77 icons.Add(extension_misc::EXTENSION_ICON_GIGANTOR, "bar"); |
78 | 78 |
79 EXPECT_EQ(extension_misc::EXTENSION_ICON_BITTY, | 79 EXPECT_EQ(extension_misc::EXTENSION_ICON_BITTY, |
80 icons.GetIconSizeFromPath("foo")); | 80 icons.GetIconSizeFromPath("foo")); |
81 EXPECT_EQ(extension_misc::EXTENSION_ICON_GIGANTOR, | 81 EXPECT_EQ(extension_misc::EXTENSION_ICON_GIGANTOR, |
82 icons.GetIconSizeFromPath("bar")); | 82 icons.GetIconSizeFromPath("bar")); |
83 EXPECT_EQ(extension_misc::EXTENSION_ICON_INVALID, | 83 EXPECT_EQ(extension_misc::EXTENSION_ICON_INVALID, |
84 icons.GetIconSizeFromPath("baz")); | 84 icons.GetIconSizeFromPath("baz")); |
85 EXPECT_EQ(extension_misc::EXTENSION_ICON_INVALID, | 85 EXPECT_EQ(extension_misc::EXTENSION_ICON_INVALID, |
86 icons.GetIconSizeFromPath("")); | 86 icons.GetIconSizeFromPath(std::string())); |
87 | 87 |
88 icons.Clear(); | 88 icons.Clear(); |
89 EXPECT_EQ(extension_misc::EXTENSION_ICON_INVALID, | 89 EXPECT_EQ(extension_misc::EXTENSION_ICON_INVALID, |
90 icons.GetIconSizeFromPath("foo")); | 90 icons.GetIconSizeFromPath("foo")); |
91 } | 91 } |
92 | 92 |
93 } // namespace | 93 } // namespace |
OLD | NEW |