summaryrefslogtreecommitdiffstats
path: root/chrome/common/extensions/extension_manifests_unittest.cc
diff options
context:
space:
mode:
authorzelidrag@chromium.org <zelidrag@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-16 08:49:30 +0000
committerzelidrag@chromium.org <zelidrag@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-16 08:49:30 +0000
commit99b370004f7d287d9904275255967d8e6edf1e7d (patch)
treed0a69d77ff9df70e6e587fb704bb7b40339090c4 /chrome/common/extensions/extension_manifests_unittest.cc
parent76066e5180a794b39d8f9550937b37b05f7793e8 (diff)
downloadchromium_src-99b370004f7d287d9904275255967d8e6edf1e7d.zip
chromium_src-99b370004f7d287d9904275255967d8e6edf1e7d.tar.gz
chromium_src-99b370004f7d287d9904275255967d8e6edf1e7d.tar.bz2
Revert 81865 - New fileBrowserPrivate and fileHandler APIs added + plus magic needed to safely hand over access to local file system elements from content extension to 3rd party extension.As agreed with aa@ and asargent@, this new API defines following event:chrome.fileHandler.onExecute.addListener(function(id, file_entries) {}This event is invoked when user selects files in ChromeOS file browser. The extension needs to register itself as file content hanlder with following manifest changes: ... "file_browser_actions": [ { "id" : "ActionIdentifier", "default_title" : "Action title", "default_icon" : "icon.png", "file_filters" : [ "filesystem:*.jpeg", ... ] } ... ], ...BUG=chromium-os:11996TEST=ExtensionApiTest.FileBrowserTest, ExtensionManifestTest.FileBrowserActionsReview URL: http://codereview.chromium.org/6749021
TBR=zelidrag@chromium.org Review URL: http://codereview.chromium.org/6873031 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@81866 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/extensions/extension_manifests_unittest.cc')
-rw-r--r--chrome/common/extensions/extension_manifests_unittest.cc37
1 files changed, 0 insertions, 37 deletions
diff --git a/chrome/common/extensions/extension_manifests_unittest.cc b/chrome/common/extensions/extension_manifests_unittest.cc
index f304619..092e9e1 100644
--- a/chrome/common/extensions/extension_manifests_unittest.cc
+++ b/chrome/common/extensions/extension_manifests_unittest.cc
@@ -16,8 +16,6 @@
#include "chrome/common/extensions/extension_constants.h"
#include "chrome/common/extensions/extension_error_utils.h"
#include "chrome/common/extensions/extension_sidebar_defaults.h"
-#include "chrome/common/extensions/file_browser_handler.h"
-#include "chrome/common/extensions/url_pattern.h"
#include "content/common/json_value_serializer.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -570,38 +568,3 @@ TEST_F(ExtensionManifestTest, IsolatedApps) {
EXPECT_TRUE(extension2->is_storage_isolated());
*CommandLine::ForCurrentProcess() = old_command_line;
}
-
-
-TEST_F(ExtensionManifestTest, FileBrowserHandlers) {
- LoadAndExpectError("filebrowser_invalid_actions_1.json",
- errors::kInvalidFileBrowserHandler);
- LoadAndExpectError("filebrowser_invalid_actions_2.json",
- errors::kInvalidFileBrowserHandler);
- LoadAndExpectError("filebrowser_invalid_action_id.json",
- errors::kInvalidPageActionId);
- LoadAndExpectError("filebrowser_invalid_action_title.json",
- errors::kInvalidPageActionDefaultTitle);
- LoadAndExpectError("filebrowser_invalid_action_id.json",
- errors::kInvalidPageActionId);
- LoadAndExpectError("filebrowser_invalid_file_filters_1.json",
- errors::kInvalidFileFiltersList);
- LoadAndExpectError("filebrowser_invalid_file_filters_2.json",
- ExtensionErrorUtils::FormatErrorMessage(
- errors::kInvalidFileFilterValue, base::IntToString(0)));
- LoadAndExpectError("filebrowser_invalid_file_filters_url.json",
- ExtensionErrorUtils::FormatErrorMessage(errors::kInvalidURLPatternError,
- "http:*.html"));
-
- scoped_refptr<Extension> extension(
- LoadAndExpectSuccess("filebrowser_valid.json"));
- ASSERT_TRUE(extension->file_browser_handlers() != NULL);
- ASSERT_EQ(extension->file_browser_handlers()->size(), 1U);
- const FileBrowserHandler* action =
- extension->file_browser_handlers()->at(0).get();
- EXPECT_EQ(action->title(), "Default title");
- EXPECT_EQ(action->icon_path(), "icon.png");
- const FileBrowserHandler::PatternList& patterns = action->file_url_patterns();
- ASSERT_EQ(patterns.size(), 1U);
- ASSERT_TRUE(action->MatchesURL(
- GURL("filesystem:chrome-extension://foo/local/test.txt")));
-}