Index: chrome/browser/chromeos/drive/drive_file_system_util_unittest.cc |
diff --git a/chrome/browser/chromeos/drive/drive_file_system_util_unittest.cc b/chrome/browser/chromeos/drive/drive_file_system_util_unittest.cc |
index 70ba8e5fd874f8d2fcd55a908de0ac2d5e0b3911..0a90b7c6277a08ba33613fe084db784c14356289 100644 |
--- a/chrome/browser/chromeos/drive/drive_file_system_util_unittest.cc |
+++ b/chrome/browser/chromeos/drive/drive_file_system_util_unittest.cc |
@@ -76,6 +76,28 @@ TEST(DriveFileSystemUtilTest, ExtractDrivePath) { |
"/special/drive/subdir/foo.txt"))); |
} |
+TEST(DriveFileSystemUtilTest, ExtractDrivePathFromFileSystemUrl) { |
+ const GURL dummy_origin("chrome-extension://extension-id"); |
+ EXPECT_EQ(base::FilePath::FromUTF8Unsafe("drive/foo/bar"), |
+ ExtractDrivePathFromFileSystemUrl( |
+ fileapi::FileSystemURL::CreateForTest( |
+ dummy_origin, |
+ fileapi::kFileSystemTypeDrive, |
+ base::FilePath::FromUTF8Unsafe("/special/drive/foo/bar")))); |
+ EXPECT_EQ(base::FilePath(), |
+ ExtractDrivePathFromFileSystemUrl( |
+ fileapi::FileSystemURL::CreateForTest( |
+ dummy_origin, |
+ fileapi::kFileSystemTypeDrive, |
+ base::FilePath::FromUTF8Unsafe("/special/drivex/foo")))); |
+ EXPECT_EQ(base::FilePath(), |
hashimoto
2013/04/08 03:51:00
How about testing a case where |virtual_path| is d
kinaba
2013/04/08 05:47:50
Done. I hope the things became clearer.
|
+ ExtractDrivePathFromFileSystemUrl( |
+ fileapi::FileSystemURL::CreateForTest( |
+ dummy_origin, |
+ fileapi::kFileSystemTypeNativeLocal, |
+ base::FilePath::FromUTF8Unsafe("/Downloads/foo.txt")))); |
+} |
+ |
TEST(DriveFileSystemUtilTest, EscapeUnescapeCacheFileName) { |
const std::string kUnescapedFileName( |
"tmp:`~!@#$%^&*()-_=+[{|]}\\\\;\',<.>/?"); |