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

Unified Diff: extensions/common/file_util_unittest.cc

Issue 1541113003: Revert of Change extension icon load errors to warnings (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: manual rebase 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 5148737ba0258d700ecf0e376ca76fc9b010f322..634b3382662e8367bb2db1bb4b21f80cedffe636 100644
--- a/extensions/common/file_util_unittest.cc
+++ b/extensions/common/file_util_unittest.cc
@@ -416,39 +416,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