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

Unified Diff: chrome/browser/chromeos/drive/drive_file_system_util_unittest.cc

Issue 13767002: Use ExtractDrivePath(path()) instead of virtual_path() for getting Drive path. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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/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:`~!@#$%^&*()-_=+[{|]}\\\\;\',<.>/?");
« no previous file with comments | « chrome/browser/chromeos/drive/drive_file_system_util.cc ('k') | chrome/browser/chromeos/drive/drive_task_executor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698