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

Unified Diff: extensions/common/file_util_unittest.cc

Issue 1554583002: Revert of Change extension icon load errors to warnings (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix merge issues 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
« no previous file with comments | « extensions/common/file_util.cc ('k') | extensions/common/manifest_handler_helpers.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/common/file_util_unittest.cc
diff --git a/extensions/common/file_util_unittest.cc b/extensions/common/file_util_unittest.cc
index afbcf3c83e6bd0ddaec206709f8bca20d6d6cf88..0bfb8b9d79acc16cbb3d91d9fd1962751384d36d 100644
--- a/extensions/common/file_util_unittest.cc
+++ b/extensions/common/file_util_unittest.cc
@@ -419,39 +419,19 @@ TEST_F(FileUtilTest, WarnOnPrivateKey) {
"extension includes the key file.*ext_root.a_key.pem"));
}
-// Try to install an extension with a zero-length icon file.
-TEST_F(FileUtilTest, CheckZeroLengthAndMissingIconFile) {
- base::FilePath install_dir;
- ASSERT_TRUE(PathService::Get(DIR_TEST_DATA, &install_dir));
-
- base::FilePath ext_dir =
- install_dir.AppendASCII("file_util").AppendASCII("bad_icon");
-
- std::string error;
- scoped_refptr<Extension> extension(file_util::LoadExtension(
- ext_dir, Manifest::INTERNAL, Extension::NO_FLAGS, &error));
- EXPECT_TRUE(extension);
- 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);
-}
-
-// Try to install an unpacked extension with a zero-length icon file.
-TEST_F(FileUtilTest, CheckZeroLengthAndMissingIconFileUnpacked) {
+TEST_F(FileUtilTest, CheckZeroLengthIconFile) {
base::FilePath install_dir;
ASSERT_TRUE(PathService::Get(DIR_TEST_DATA, &install_dir));
+ // Try to install an extension with a zero-length icon file.
base::FilePath ext_dir =
install_dir.AppendASCII("file_util").AppendASCII("bad_icon");
std::string error;
scoped_refptr<Extension> extension(file_util::LoadExtension(
ext_dir, Manifest::UNPACKED, Extension::NO_FLAGS, &error));
- EXPECT_FALSE(extension);
- EXPECT_EQ("Could not load extension icon 'missing-icon.png'.", error);
+ EXPECT_TRUE(extension.get() == NULL);
+ EXPECT_STREQ("Could not load extension icon 'icon.png'.", error.c_str());
}
TEST_F(FileUtilTest, ExtensionURLToRelativeFilePath) {
« no previous file with comments | « extensions/common/file_util.cc ('k') | extensions/common/manifest_handler_helpers.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698