summaryrefslogtreecommitdiffstats
path: root/webkit/fileapi/file_system_path_manager_unittest.cc
diff options
context:
space:
mode:
authorzelidrag@chromium.org <zelidrag@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-25 20:37:59 +0000
committerzelidrag@chromium.org <zelidrag@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-25 20:37:59 +0000
commit55d9bed8de248d583bd5770a42c8520e1225162b (patch)
tree6be27d9ee263e9a475385120a933bcb29fe75a74 /webkit/fileapi/file_system_path_manager_unittest.cc
parente69b903ec57dc0f511598b03d4aae148a56e33bc (diff)
downloadchromium_src-55d9bed8de248d583bd5770a42c8520e1225162b.zip
chromium_src-55d9bed8de248d583bd5770a42c8520e1225162b.tar.gz
chromium_src-55d9bed8de248d583bd5770a42c8520e1225162b.tar.bz2
Wired local file system support for File API. The local file system provider currently exists for ChromeOS builds only.
This CL exposes new extension permission 'fileSystem' that controls access to individual local file system elements from 3rd party extensions. Another new permission 'fileBrowserPrivate' controls access to following API call that retrieves root DOMFileSystem instance for locally exposed folders:  chrome.fileBrowserPrivate.requestLocalFileSystem(callback) BUG=chromium-os:11983 TEST=ExtensionApiTest.LocalFileSystem Review URL: http://codereview.chromium.org/6519040 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@79451 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/fileapi/file_system_path_manager_unittest.cc')
-rw-r--r--webkit/fileapi/file_system_path_manager_unittest.cc24
1 files changed, 23 insertions, 1 deletions
diff --git a/webkit/fileapi/file_system_path_manager_unittest.cc b/webkit/fileapi/file_system_path_manager_unittest.cc
index 8f004c2..ca7a74a 100644
--- a/webkit/fileapi/file_system_path_manager_unittest.cc
+++ b/webkit/fileapi/file_system_path_manager_unittest.cc
@@ -19,6 +19,7 @@
#include "testing/gtest/include/gtest/gtest.h"
#include "webkit/fileapi/file_system_util.h"
#include "webkit/fileapi/sandbox_mount_point_provider.h"
+#include "webkit/quota/special_storage_policy.h"
using namespace fileapi;
@@ -69,6 +70,8 @@ const struct RootPathFileURITest {
"file__0" PS "Temporary" },
{ fileapi::kFileSystemTypePersistent, "file:///",
"file__0" PS "Persistent" },
+ // TODO(zelidrag): Add fileapi::kFileSystemTypeLocal test cases here once
+ // we fix ChromeOS build of this test.
};
const struct CheckValidPathTest {
@@ -160,6 +163,21 @@ const struct IsRestrictedNameTest {
{ FILE_PATH_LITERAL("|ab"), true, },
};
+class TestSpecialStoragePolicy : public quota::SpecialStoragePolicy {
+ public:
+ virtual bool IsStorageProtected(const GURL& origin) {
+ return false;
+ }
+
+ virtual bool IsStorageUnlimited(const GURL& origin) {
+ return true;
+ }
+
+ virtual bool IsLocalFileSystemAccessAllowed(const GURL& origin) {
+ return true;
+ }
+};
+
} // namespace
class FileSystemPathManagerTest : public testing::Test {
@@ -181,7 +199,11 @@ class FileSystemPathManagerTest : public testing::Test {
bool allow_file_access) {
return new FileSystemPathManager(
base::MessageLoopProxy::CreateForCurrentThread(),
- data_dir_.path(), incognito, allow_file_access);
+ data_dir_.path(),
+ scoped_refptr<quota::SpecialStoragePolicy>(
+ new TestSpecialStoragePolicy()),
+ incognito,
+ allow_file_access);
}
void OnGetRootPath(bool success,