| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/fileapi/file_system_backend.h" | 5 #include "chrome/browser/chromeos/fileapi/file_system_backend.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 | 8 |
| 9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 10 #include "chromeos/dbus/cros_disks_client.h" | 10 #include "chromeos/dbus/cros_disks_client.h" |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 std::vector<base::FilePath> root_dirs = backend.GetRootDirectories(); | 94 std::vector<base::FilePath> root_dirs = backend.GetRootDirectories(); |
| 95 std::set<base::FilePath> root_dirs_set(root_dirs.begin(), root_dirs.end()); | 95 std::set<base::FilePath> root_dirs_set(root_dirs.begin(), root_dirs.end()); |
| 96 EXPECT_EQ(initial_root_dirs_size + 4, root_dirs.size()); | 96 EXPECT_EQ(initial_root_dirs_size + 4, root_dirs.size()); |
| 97 EXPECT_TRUE(root_dirs_set.count(base::FilePath(FPL("/a/b/c")))); | 97 EXPECT_TRUE(root_dirs_set.count(base::FilePath(FPL("/a/b/c")))); |
| 98 EXPECT_TRUE(root_dirs_set.count(base::FilePath(FPL("/b/c/d")))); | 98 EXPECT_TRUE(root_dirs_set.count(base::FilePath(FPL("/b/c/d")))); |
| 99 EXPECT_TRUE(root_dirs_set.count(base::FilePath(FPL("/g/c/d")))); | 99 EXPECT_TRUE(root_dirs_set.count(base::FilePath(FPL("/g/c/d")))); |
| 100 EXPECT_TRUE(root_dirs_set.count(base::FilePath(FPL("/g/d/e")))); | 100 EXPECT_TRUE(root_dirs_set.count(base::FilePath(FPL("/g/d/e")))); |
| 101 } | 101 } |
| 102 | 102 |
| 103 TEST(ChromeOSFileSystemBackendTest, AccessPermissions) { | 103 TEST(ChromeOSFileSystemBackendTest, AccessPermissions) { |
| 104 url::AddStandardScheme("chrome-extension"); | 104 url::AddStandardScheme("chrome-extension", url::SCHEME_WITHOUT_PORT); |
| 105 | 105 |
| 106 scoped_refptr<storage::ExternalMountPoints> mount_points( | 106 scoped_refptr<storage::ExternalMountPoints> mount_points( |
| 107 storage::ExternalMountPoints::CreateRefCounted()); | 107 storage::ExternalMountPoints::CreateRefCounted()); |
| 108 scoped_refptr<storage::ExternalMountPoints> system_mount_points( | 108 scoped_refptr<storage::ExternalMountPoints> system_mount_points( |
| 109 storage::ExternalMountPoints::CreateRefCounted()); | 109 storage::ExternalMountPoints::CreateRefCounted()); |
| 110 chromeos::FileSystemBackend backend(NULL, // drive_delegate | 110 chromeos::FileSystemBackend backend(NULL, // drive_delegate |
| 111 NULL, // file_system_provider_delegate | 111 NULL, // file_system_provider_delegate |
| 112 NULL, // mtp_delegate | 112 NULL, // mtp_delegate |
| 113 mount_points.get(), | 113 mount_points.get(), |
| 114 system_mount_points.get()); | 114 system_mount_points.get()); |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 if (!kTestCases[i].success) | 234 if (!kTestCases[i].success) |
| 235 continue; | 235 continue; |
| 236 | 236 |
| 237 base::FilePath expected_virtual_path(kTestCases[i].virtual_path); | 237 base::FilePath expected_virtual_path(kTestCases[i].virtual_path); |
| 238 EXPECT_EQ(expected_virtual_path, virtual_path) | 238 EXPECT_EQ(expected_virtual_path, virtual_path) |
| 239 << "Resolving " << kTestCases[i].local_path; | 239 << "Resolving " << kTestCases[i].local_path; |
| 240 } | 240 } |
| 241 } | 241 } |
| 242 | 242 |
| 243 } // namespace | 243 } // namespace |
| OLD | NEW |