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

Unified Diff: webkit/fileapi/syncable/syncable_file_system_util_unittest.cc

Issue 16072003: Fix module dependency in file_system_url* (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 months 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 | « webkit/fileapi/file_system_url_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/fileapi/syncable/syncable_file_system_util_unittest.cc
diff --git a/webkit/fileapi/syncable/syncable_file_system_util_unittest.cc b/webkit/fileapi/syncable/syncable_file_system_util_unittest.cc
index 592e7c429377eac5d61f53c409dac9bb62321e09..7024aa8e8c353fe0b21bb2c7a9d5ca611d26e4f6 100644
--- a/webkit/fileapi/syncable/syncable_file_system_util_unittest.cc
+++ b/webkit/fileapi/syncable/syncable_file_system_util_unittest.cc
@@ -9,6 +9,7 @@
#include "base/message_loop_proxy.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "webkit/browser/fileapi/external_mount_points.h"
+#include "webkit/fileapi/file_system_types.h"
#include "webkit/fileapi/syncable/canned_syncable_file_system.h"
#include "webkit/fileapi/syncable/local_file_sync_context.h"
@@ -146,4 +147,31 @@ TEST(SyncableFileSystemUtilTest, SerializeBeforeOpenFileSystem) {
base::MessageLoop::current()->RunUntilIdle();
}
+TEST(SyncableFileSystemUtilTest, SyncableFileSystemURL_IsParent) {
+ ScopedExternalFileSystem scoped1("foo", fileapi::kFileSystemTypeSyncable,
+ base::FilePath());
+ ScopedExternalFileSystem scoped2("bar", fileapi::kFileSystemTypeSyncable,
+ base::FilePath());
+
+ const std::string root1 = sync_file_system::GetSyncableFileSystemRootURI(
+ GURL("http://example.com"), "foo").spec();
+ const std::string root2 = sync_file_system::GetSyncableFileSystemRootURI(
+ GURL("http://example.com"), "bar").spec();
+
+ const std::string parent("dir");
+ const std::string child("dir/child");
+
+ // True case.
+ EXPECT_TRUE(CreateFileSystemURL(root1 + parent).IsParent(
+ CreateFileSystemURL(root1 + child)));
+ EXPECT_TRUE(CreateFileSystemURL(root2 + parent).IsParent(
+ CreateFileSystemURL(root2 + child)));
+
+ // False case: different filesystem ID.
+ EXPECT_FALSE(CreateFileSystemURL(root1 + parent).IsParent(
+ CreateFileSystemURL(root2 + child)));
+ EXPECT_FALSE(CreateFileSystemURL(root2 + parent).IsParent(
+ CreateFileSystemURL(root1 + child)));
+}
+
} // namespace sync_file_system
« no previous file with comments | « webkit/fileapi/file_system_url_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698