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

Unified Diff: webkit/fileapi/file_system_url_unittest.cc

Issue 11787028: New FileSystemURL cracking (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 11 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
Index: webkit/fileapi/file_system_url_unittest.cc
diff --git a/webkit/fileapi/file_system_url_unittest.cc b/webkit/fileapi/file_system_url_unittest.cc
index c1c01a37331ff910a9c821d9ec870f345e7324e1..61e67f0a0f4827f0bed01f2c116b2ca4f124b18c 100644
--- a/webkit/fileapi/file_system_url_unittest.cc
+++ b/webkit/fileapi/file_system_url_unittest.cc
@@ -26,7 +26,22 @@ namespace fileapi {
namespace {
FileSystemURL CreateFileSystemURL(const std::string& url_string) {
- return FileSystemURL(GURL(url_string));
+ FileSystemURL url = FileSystemURL(GURL(url_string));
+ switch (url.type()) {
+ case kFileSystemTypeExternal:
+ return ExternalMountPoints::GetSystemInstance()->CrackURL(url);
+ case kFileSystemTypeIsolated:
+ return IsolatedContext::GetInstance()->CrackURL(url);
+ default:
+ return url;
+ }
+}
+
+FileSystemURL CreateExternalFileSystemURL(const GURL& origin,
+ FileSystemType type,
+ const FilePath& path) {
+ FileSystemURL url(origin, type, path);
+ return ExternalMountPoints::GetSystemInstance()->CrackURL(url);
}
std::string NormalizedUTF8Path(const FilePath& path) {
@@ -225,8 +240,10 @@ TEST(FileSystemURLTest, DebugString) {
ScopedExternalFileSystem scoped_fs("foo",
kFileSystemTypeNativeLocal,
kRoot.NormalizePathSeparators());
- const FileSystemURL kURL2(kOrigin, kFileSystemTypeExternal,
- scoped_fs.GetVirtualRootPath().Append(kPath));
+ const FileSystemURL kURL2(CreateExternalFileSystemURL(
+ kOrigin,
+ kFileSystemTypeExternal,
+ scoped_fs.GetVirtualRootPath().Append(kPath)));
EXPECT_EQ("filesystem:http://example.com/external/" +
NormalizedUTF8Path(scoped_fs.GetVirtualRootPath().Append(kPath)) +
" (NativeLocal@foo:" +

Powered by Google App Engine
This is Rietveld 408576698