summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoragl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-22 16:29:20 +0000
committeragl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-22 16:29:20 +0000
commit225f96843f57da5db0c266d9287619a022fb5446 (patch)
tree4da9afaad4cc19de0ae106b702d4ad2609fcca48
parente72831cac8859a56b03ec76b1c1d4b7fe7409b9d (diff)
downloadchromium_src-225f96843f57da5db0c266d9287619a022fb5446.zip
chromium_src-225f96843f57da5db0c266d9287619a022fb5446.tar.gz
chromium_src-225f96843f57da5db0c266d9287619a022fb5446.tar.bz2
Revert "Allow symlinks in unpacked extensions."
This reverts r138265 as it broke something that the commit bot didn't pick up on. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@138271 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/extensions/extension_service_unittest.cc30
-rw-r--r--chrome/browser/extensions/unpacked_installer.cc4
-rw-r--r--chrome/test/data/extensions/unpacked/symlinks_allowed/icon.pngbin2799 -> 0 bytes
-rw-r--r--chrome/test/data/extensions/unpacked/symlinks_allowed/manifest.json9
4 files changed, 2 insertions, 41 deletions
diff --git a/chrome/browser/extensions/extension_service_unittest.cc b/chrome/browser/extensions/extension_service_unittest.cc
index 3a89884..127a2a1 100644
--- a/chrome/browser/extensions/extension_service_unittest.cc
+++ b/chrome/browser/extensions/extension_service_unittest.cc
@@ -1878,36 +1878,6 @@ TEST_F(ExtensionServiceTest, UnpackedExtensionCanChangeID) {
// we should also test that preferences are preserved.
}
-TEST_F(ExtensionServiceTest, UnpackedExtensionMayContainSymlinkedFiles) {
- FilePath source_data_dir = data_dir_.
- AppendASCII("unpacked").
- AppendASCII("symlinks_allowed");
-
- // Paths to test data files.
- FilePath source_manifest = source_data_dir.AppendASCII("manifest.json");
- ASSERT_TRUE(file_util::PathExists(source_manifest));
- FilePath source_icon = source_data_dir.AppendASCII("icon.png");
- ASSERT_TRUE(file_util::PathExists(source_icon));
-
- // Set up the temporary extension directory.
- ScopedTempDir temp;
- ASSERT_TRUE(temp.CreateUniqueTempDir());
- FilePath extension_path = temp.path();
- FilePath manifest = extension_path.Append(Extension::kManifestFilename);
- FilePath icon_symlink = extension_path.Append("icon.png");
- file_util::CopyFile(source_manifest, manifest);
- file_util::CreateSymbolicLink(source_icon, icon_symlink);
-
- // Load extension.
- InitializeEmptyExtensionService();
- extensions::UnpackedInstaller::Create(service_)->Load(extension_path);
- loop_.RunAllPending();
-
- EXPECT_TRUE(GetErrors().empty());
- ASSERT_EQ(1u, loaded_.size());
- EXPECT_EQ(1u, service_->extensions()->size());
-}
-
TEST_F(ExtensionServiceTest, InstallLocalizedTheme) {
InitializeEmptyExtensionService();
FilePath theme_path = data_dir_
diff --git a/chrome/browser/extensions/unpacked_installer.cc b/chrome/browser/extensions/unpacked_installer.cc
index 3bfb522..39e5513 100644
--- a/chrome/browser/extensions/unpacked_installer.cc
+++ b/chrome/browser/extensions/unpacked_installer.cc
@@ -132,7 +132,7 @@ void UnpackedInstaller::LoadFromCommandLine(const FilePath& path_in) {
scoped_refptr<const Extension> extension(extension_file_util::LoadExtension(
extension_path_,
Extension::LOAD,
- flags | Extension::FOLLOW_SYMLINKS_ANYWHERE,
+ flags,
&error));
if (!extension) {
@@ -195,7 +195,7 @@ void UnpackedInstaller::LoadWithFileAccess(bool allow_file_access) {
scoped_refptr<const Extension> extension(extension_file_util::LoadExtension(
extension_path_,
Extension::LOAD,
- flags | Extension::FOLLOW_SYMLINKS_ANYWHERE,
+ flags,
&error));
if (!extension) {
diff --git a/chrome/test/data/extensions/unpacked/symlinks_allowed/icon.png b/chrome/test/data/extensions/unpacked/symlinks_allowed/icon.png
deleted file mode 100644
index 84c4be3..0000000
--- a/chrome/test/data/extensions/unpacked/symlinks_allowed/icon.png
+++ /dev/null
Binary files differ
diff --git a/chrome/test/data/extensions/unpacked/symlinks_allowed/manifest.json b/chrome/test/data/extensions/unpacked/symlinks_allowed/manifest.json
deleted file mode 100644
index 7210509..0000000
--- a/chrome/test/data/extensions/unpacked/symlinks_allowed/manifest.json
+++ /dev/null
@@ -1,9 +0,0 @@
-{
- "name": "Test for symlinked content in unpacked extension",
- "description": "This is an extension used to test that file symlinks are allowed within unpacked extensions",
- "version": "1",
- "manifest_version": 2,
- "browser_action": {
- "default_icon": "icon.png"
- }
-}