| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/chromeos/drive/drive_file_system_util.h" | 5 #include "chrome/browser/chromeos/drive/drive_file_system_util.h" |
| 6 | 6 |
| 7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
| 8 #include "base/files/scoped_temp_dir.h" | 8 #include "base/files/scoped_temp_dir.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 EXPECT_EQ(base::FilePath::FromUTF8Unsafe("drive/subdir/foo.txt"), | 83 EXPECT_EQ(base::FilePath::FromUTF8Unsafe("drive/subdir/foo.txt"), |
| 84 ExtractDrivePath(base::FilePath::FromUTF8Unsafe( | 84 ExtractDrivePath(base::FilePath::FromUTF8Unsafe( |
| 85 "/special/drive/subdir/foo.txt"))); | 85 "/special/drive/subdir/foo.txt"))); |
| 86 } | 86 } |
| 87 | 87 |
| 88 TEST(DriveFileSystemUtilTest, ExtractDrivePathFromFileSystemUrl) { | 88 TEST(DriveFileSystemUtilTest, ExtractDrivePathFromFileSystemUrl) { |
| 89 // Set up file system context for testing. | 89 // Set up file system context for testing. |
| 90 base::ScopedTempDir temp_dir_; | 90 base::ScopedTempDir temp_dir_; |
| 91 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); | 91 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); |
| 92 | 92 |
| 93 MessageLoop message_loop; | 93 base::MessageLoop message_loop; |
| 94 scoped_refptr<fileapi::ExternalMountPoints> mount_points = | 94 scoped_refptr<fileapi::ExternalMountPoints> mount_points = |
| 95 fileapi::ExternalMountPoints::CreateRefCounted(); | 95 fileapi::ExternalMountPoints::CreateRefCounted(); |
| 96 scoped_refptr<fileapi::FileSystemContext> context( | 96 scoped_refptr<fileapi::FileSystemContext> context( |
| 97 new fileapi::FileSystemContext( | 97 new fileapi::FileSystemContext( |
| 98 fileapi::FileSystemTaskRunners::CreateMockTaskRunners(), | 98 fileapi::FileSystemTaskRunners::CreateMockTaskRunners(), |
| 99 mount_points, | 99 mount_points, |
| 100 NULL, // special_storage_policy | 100 NULL, // special_storage_policy |
| 101 NULL, // quota_manager_proxy, | 101 NULL, // quota_manager_proxy, |
| 102 ScopedVector<fileapi::FileSystemMountPointProvider>(), | 102 ScopedVector<fileapi::FileSystemMountPointProvider>(), |
| 103 temp_dir_.path(), // partition_path | 103 temp_dir_.path(), // partition_path |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 EXPECT_FALSE(util::IsSpecialResourceId("file:123")); | 263 EXPECT_FALSE(util::IsSpecialResourceId("file:123")); |
| 264 EXPECT_FALSE(util::IsSpecialResourceId("folder:root")); | 264 EXPECT_FALSE(util::IsSpecialResourceId("folder:root")); |
| 265 EXPECT_FALSE(util::IsSpecialResourceId("folder:xyz")); | 265 EXPECT_FALSE(util::IsSpecialResourceId("folder:xyz")); |
| 266 | 266 |
| 267 EXPECT_TRUE(util::IsSpecialResourceId("<drive>")); | 267 EXPECT_TRUE(util::IsSpecialResourceId("<drive>")); |
| 268 EXPECT_TRUE(util::IsSpecialResourceId("<other>")); | 268 EXPECT_TRUE(util::IsSpecialResourceId("<other>")); |
| 269 } | 269 } |
| 270 | 270 |
| 271 } // namespace util | 271 } // namespace util |
| 272 } // namespace drive | 272 } // namespace drive |
| OLD | NEW |