summaryrefslogtreecommitdiffstats
path: root/webkit/fileapi/isolated_context_unittest.cc
diff options
context:
space:
mode:
authorkinuko@chromium.org <kinuko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-02 09:35:05 +0000
committerkinuko@chromium.org <kinuko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-02 09:35:05 +0000
commit6fe6965e2d0e4ac248d6825a88b5e53a77ac5ffe (patch)
tree674002b384f19261c6bf00c1033954b7a771345c /webkit/fileapi/isolated_context_unittest.cc
parentb93a8aea9cc770f414fdfad8fad7dcae432eb177 (diff)
downloadchromium_src-6fe6965e2d0e4ac248d6825a88b5e53a77ac5ffe.zip
chromium_src-6fe6965e2d0e4ac248d6825a88b5e53a77ac5ffe.tar.gz
chromium_src-6fe6965e2d0e4ac248d6825a88b5e53a77ac5ffe.tar.bz2
Add isolated file_util for directory (and file) drag-and-drop support.
patch from http://codereview.chromium.org/9204009/ BUG=99823 TEST=test_shell_tests:IsolatedFileUtil* Review URL: https://chromiumcodereview.appspot.com/9272007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@130110 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/fileapi/isolated_context_unittest.cc')
-rw-r--r--webkit/fileapi/isolated_context_unittest.cc20
1 files changed, 12 insertions, 8 deletions
diff --git a/webkit/fileapi/isolated_context_unittest.cc b/webkit/fileapi/isolated_context_unittest.cc
index e32adef..5a828f5 100644
--- a/webkit/fileapi/isolated_context_unittest.cc
+++ b/webkit/fileapi/isolated_context_unittest.cc
@@ -77,11 +77,13 @@ TEST_F(IsolatedContextTest, RegisterAndRevokeTest) {
FilePath virtual_path = isolated_context()->CreateVirtualPath(
id_, kTestPaths[i].BaseName());
std::string cracked_id;
- FilePath cracked_path;
+ FilePath root_path, cracked_path;
ASSERT_TRUE(isolated_context()->CrackIsolatedPath(
- virtual_path, &cracked_id, &cracked_path));
+ virtual_path, &cracked_id, &root_path, &cracked_path));
ASSERT_EQ(kTestPaths[i].NormalizePathSeparators().value(),
cracked_path.value());
+ ASSERT_TRUE(fileset_.find(root_path.NormalizePathSeparators())
+ != fileset_.end());
ASSERT_EQ(id_, cracked_id);
}
@@ -123,14 +125,16 @@ TEST_F(IsolatedContextTest, CrackWithRelativePaths) {
FilePath virtual_path = isolated_context()->CreateVirtualPath(
id_, kTestPaths[i].BaseName().Append(relatives[j].path));
std::string cracked_id;
- FilePath cracked_path;
+ FilePath root_path, cracked_path;
if (!relatives[j].valid) {
ASSERT_FALSE(isolated_context()->CrackIsolatedPath(
- virtual_path, &cracked_id, &cracked_path));
+ virtual_path, &cracked_id, &root_path, &cracked_path));
continue;
}
ASSERT_TRUE(isolated_context()->CrackIsolatedPath(
- virtual_path, &cracked_id, &cracked_path));
+ virtual_path, &cracked_id, &root_path, &cracked_path));
+ ASSERT_TRUE(fileset_.find(root_path.NormalizePathSeparators())
+ != fileset_.end());
ASSERT_EQ(kTestPaths[i].Append(relatives[j].path)
.NormalizePathSeparators().value(),
cracked_path.value());
@@ -141,7 +145,7 @@ TEST_F(IsolatedContextTest, CrackWithRelativePaths) {
TEST_F(IsolatedContextTest, TestWithVirtualRoot) {
std::string cracked_id;
- FilePath cracked_path;
+ FilePath root_path, cracked_path;
const FilePath root(FPL("/"));
// Trying to crack virtual root "/" returns true but with empty cracked path
@@ -149,7 +153,7 @@ TEST_F(IsolatedContextTest, TestWithVirtualRoot) {
// that has no corresponding platform directory.
FilePath virtual_path = isolated_context()->CreateVirtualPath(id_, root);
ASSERT_TRUE(isolated_context()->CrackIsolatedPath(
- virtual_path, &cracked_id, &cracked_path));
+ virtual_path, &cracked_id, &root_path, &cracked_path));
ASSERT_EQ(FPL(""), cracked_path.value());
ASSERT_EQ(id_, cracked_id);
@@ -158,7 +162,7 @@ TEST_F(IsolatedContextTest, TestWithVirtualRoot) {
virtual_path = isolated_context()->CreateVirtualPath(
id_, FilePath(FPL("foo")));
ASSERT_FALSE(isolated_context()->CrackIsolatedPath(
- virtual_path, &cracked_id, &cracked_path));
+ virtual_path, &cracked_id, &root_path, &cracked_path));
}
} // namespace fileapi