Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(44)

Unified Diff: extensions/common/file_util_unittest.cc

Issue 1537473003: Change extension icon load errors to warnings (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: conciser Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: extensions/common/file_util_unittest.cc
diff --git a/extensions/common/file_util_unittest.cc b/extensions/common/file_util_unittest.cc
index 0814334bfacc283895372b39d95bdc636eeb7d2e..dc9e59ec6e6f0c734876811864127c2bc636aff2 100644
--- a/extensions/common/file_util_unittest.cc
+++ b/extensions/common/file_util_unittest.cc
@@ -414,7 +414,7 @@ TEST_F(FileUtilTest, WarnOnPrivateKey) {
"extension includes the key file.*ext_root.a_key.pem"));
}
-TEST_F(FileUtilTest, CheckZeroLengthIconFile) {
+TEST_F(FileUtilTest, CheckZeroLengthAndMissingIconFile) {
base::FilePath install_dir;
ASSERT_TRUE(PathService::Get(DIR_TEST_DATA, &install_dir));
@@ -425,8 +425,13 @@ TEST_F(FileUtilTest, CheckZeroLengthIconFile) {
std::string error;
scoped_refptr<Extension> extension(file_util::LoadExtension(
ext_dir, Manifest::UNPACKED, Extension::NO_FLAGS, &error));
- EXPECT_TRUE(extension.get() == NULL);
- EXPECT_STREQ("Could not load extension icon 'icon.png'.", error.c_str());
+ EXPECT_TRUE(extension.get());
+ ASSERT_EQ(2U, extension->install_warnings().size());
+
+ EXPECT_EQ("Could not load extension icon 'missing-icon.png'.",
+ extension->install_warnings()[0].message);
+ EXPECT_EQ("Could not load extension icon 'icon.png'.",
+ extension->install_warnings()[1].message);
}
TEST_F(FileUtilTest, ExtensionURLToRelativeFilePath) {

Powered by Google App Engine
This is Rietveld 408576698