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

Unified Diff: chrome/browser/chromeos/file_system_provider/mount_path_util_unittest.cc

Issue 258783006: [fsp] Add the getMetadata operation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased. Created 6 years, 8 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: chrome/browser/chromeos/file_system_provider/mount_path_util_unittest.cc
diff --git a/chrome/browser/chromeos/file_system_provider/mount_path_util_unittest.cc b/chrome/browser/chromeos/file_system_provider/mount_path_util_unittest.cc
index f4f843b1b399cb98a90ece4d07ebbe471f32710c..80fb16ade7c43a43ae417b5c136fa3c98e759aa2 100644
--- a/chrome/browser/chromeos/file_system_provider/mount_path_util_unittest.cc
+++ b/chrome/browser/chromeos/file_system_provider/mount_path_util_unittest.cc
@@ -43,10 +43,12 @@ fileapi::FileSystemURL CreateFileSystemURL(Profile* profile,
const fileapi::ExternalMountPoints* const mount_points =
fileapi::ExternalMountPoints::GetSystemInstance();
DCHECK(mount_points);
+ DCHECK(file_path.IsAbsolute());
+ base::FilePath relative_path(file_path.value().substr(1));
return mount_points->CreateCrackedFileSystemURL(
GURL(origin),
fileapi::kFileSystemTypeExternal,
- base::FilePath(mount_path.BaseName().Append(file_path)));
+ base::FilePath(mount_path.BaseName().Append(relative_path)));
}
// Creates a Service instance. Used to be able to destroy the service in
@@ -105,7 +107,8 @@ TEST_F(FileSystemProviderMountPathUtilTest, Parser) {
kExtensionId, kFileSystemName);
EXPECT_LT(0, file_system_id);
- const base::FilePath kFilePath = base::FilePath("hello/world.txt");
+ const base::FilePath kFilePath =
+ base::FilePath::FromUTF8Unsafe("/hello/world.txt");
const fileapi::FileSystemURL url =
CreateFileSystemURL(profile_, kExtensionId, file_system_id, kFilePath);
EXPECT_TRUE(url.is_valid());
@@ -124,7 +127,7 @@ TEST_F(FileSystemProviderMountPathUtilTest, Parser_RootPath) {
kExtensionId, kFileSystemName);
EXPECT_LT(0, file_system_id);
- const base::FilePath kFilePath = base::FilePath();
+ const base::FilePath kFilePath = base::FilePath::FromUTF8Unsafe("/");
const fileapi::FileSystemURL url =
CreateFileSystemURL(profile_, kExtensionId, file_system_id, kFilePath);
EXPECT_TRUE(url.is_valid());
@@ -143,7 +146,7 @@ TEST_F(FileSystemProviderMountPathUtilTest, Parser_WrongUrl) {
kExtensionId, kFileSystemName);
EXPECT_LT(0, file_system_id);
- const base::FilePath kFilePath = base::FilePath("hello");
+ const base::FilePath kFilePath = base::FilePath::FromUTF8Unsafe("/hello");
const fileapi::FileSystemURL url = CreateFileSystemURL(
profile_, kExtensionId, file_system_id + 1, kFilePath);
// It is impossible to create a cracked URL for a mount point which doesn't

Powered by Google App Engine
This is Rietveld 408576698