summaryrefslogtreecommitdiffstats
path: root/chrome/common/extensions/extension_icon_set.cc
diff options
context:
space:
mode:
authoraa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-06 18:05:41 +0000
committeraa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-06 18:05:41 +0000
commit6e12377f0b289b14858149b8cfe33abac46a06f6 (patch)
tree5b944dd17db0749793d5ef7af90fe5c6d0255d90 /chrome/common/extensions/extension_icon_set.cc
parent7ef4cbbb55e58e43e7edcf358a9fb689673d39a9 (diff)
downloadchromium_src-6e12377f0b289b14858149b8cfe33abac46a06f6.zip
chromium_src-6e12377f0b289b14858149b8cfe33abac46a06f6.tar.gz
chromium_src-6e12377f0b289b14858149b8cfe33abac46a06f6.tar.bz2
Fix regression caused by r73784, add regression test and
do some minor test organization. BUG=57263,71955 TEST=Install https://chrome.google.com/webstore/detail/odmpalfplhaahlgnkkonchfhpegdcgjm and a few apps from the web store. Open popup. Popup should contain icons for each app and should not crash. Review URL: http://codereview.chromium.org/6410088 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@73956 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/extensions/extension_icon_set.cc')
-rw-r--r--chrome/common/extensions/extension_icon_set.cc10
1 files changed, 7 insertions, 3 deletions
diff --git a/chrome/common/extensions/extension_icon_set.cc b/chrome/common/extensions/extension_icon_set.cc
index 1f1dd21..fc1ac58 100644
--- a/chrome/common/extensions/extension_icon_set.cc
+++ b/chrome/common/extensions/extension_icon_set.cc
@@ -15,7 +15,7 @@ void ExtensionIconSet::Clear() {
}
void ExtensionIconSet::Add(int size, const std::string& path) {
- DCHECK(path.size() > 0 && path[0] != '/');
+ CHECK(path.size() > 0 && path[0] != '/');
map_[size] = path;
}
@@ -50,10 +50,14 @@ std::string ExtensionIconSet::Get(int size, MatchType match_type) const {
}
bool ExtensionIconSet::ContainsPath(const std::string& path) const {
- DCHECK(path.size() > 0 && path[0] != '/');
+ if (path.empty())
+ return false;
+
+ CHECK(path[0] != '/') <<
+ "ExtensionIconSet stores icon paths without leading slash.";
+
for (IconMap::const_iterator iter = map_.begin(); iter != map_.end();
++iter) {
- LOG(ERROR) << iter->second << " , " << path;
if (iter->second == path)
return true;
}