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 "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
9 | 9 |
10 namespace drive { | 10 namespace drive { |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 base::FilePath::FromUTF8Unsafe("/Downloads/x"))); | 118 base::FilePath::FromUTF8Unsafe("/Downloads/x"))); |
119 EXPECT_FALSE(NeedsNamespaceMigration( | 119 EXPECT_FALSE(NeedsNamespaceMigration( |
120 base::FilePath::FromUTF8Unsafe("/wherever/foo.txt"))); | 120 base::FilePath::FromUTF8Unsafe("/wherever/foo.txt"))); |
121 EXPECT_FALSE(NeedsNamespaceMigration( | 121 EXPECT_FALSE(NeedsNamespaceMigration( |
122 base::FilePath::FromUTF8Unsafe("/special/foo.txt"))); | 122 base::FilePath::FromUTF8Unsafe("/special/foo.txt"))); |
123 EXPECT_FALSE(NeedsNamespaceMigration( | 123 EXPECT_FALSE(NeedsNamespaceMigration( |
124 base::FilePath::FromUTF8Unsafe("/special/drivex/foo.txt"))); | 124 base::FilePath::FromUTF8Unsafe("/special/drivex/foo.txt"))); |
125 EXPECT_FALSE(NeedsNamespaceMigration( | 125 EXPECT_FALSE(NeedsNamespaceMigration( |
126 base::FilePath::FromUTF8Unsafe("special/drivex/foo.txt"))); | 126 base::FilePath::FromUTF8Unsafe("special/drivex/foo.txt"))); |
127 | 127 |
128 // Before migration. TODO(haruki): These cases should be EXPECT_TRUE. | 128 // Before migration. |
129 // Update this along with http://crbug.com/174233. | 129 EXPECT_TRUE(NeedsNamespaceMigration( |
130 EXPECT_FALSE(NeedsNamespaceMigration( | |
131 base::FilePath::FromUTF8Unsafe("/special/drive"))); | 130 base::FilePath::FromUTF8Unsafe("/special/drive"))); |
132 EXPECT_FALSE(NeedsNamespaceMigration( | 131 EXPECT_TRUE(NeedsNamespaceMigration( |
133 base::FilePath::FromUTF8Unsafe("/special/drive/foo.txt"))); | 132 base::FilePath::FromUTF8Unsafe("/special/drive/foo.txt"))); |
134 EXPECT_FALSE(NeedsNamespaceMigration( | 133 EXPECT_TRUE(NeedsNamespaceMigration( |
135 base::FilePath::FromUTF8Unsafe("/special/drive/subdir/foo.txt"))); | 134 base::FilePath::FromUTF8Unsafe("/special/drive/subdir/foo.txt"))); |
136 | 135 |
137 // Already migrated. | 136 // Already migrated. |
138 EXPECT_FALSE(NeedsNamespaceMigration( | 137 EXPECT_FALSE(NeedsNamespaceMigration( |
139 base::FilePath::FromUTF8Unsafe("/special/drive/root"))); | 138 base::FilePath::FromUTF8Unsafe("/special/drive/root"))); |
140 EXPECT_FALSE(NeedsNamespaceMigration( | 139 EXPECT_FALSE(NeedsNamespaceMigration( |
141 base::FilePath::FromUTF8Unsafe("/special/drive/root/dir1"))); | 140 base::FilePath::FromUTF8Unsafe("/special/drive/root/dir1"))); |
142 EXPECT_FALSE(NeedsNamespaceMigration( | 141 EXPECT_FALSE(NeedsNamespaceMigration( |
143 base::FilePath::FromUTF8Unsafe("/special/drive/root/root"))); | 142 base::FilePath::FromUTF8Unsafe("/special/drive/root/root"))); |
144 EXPECT_FALSE(NeedsNamespaceMigration( | 143 EXPECT_FALSE(NeedsNamespaceMigration( |
(...skipping 16 matching lines...) Expand all Loading... |
161 EXPECT_FALSE(util::IsSpecialResourceId("file:123")); | 160 EXPECT_FALSE(util::IsSpecialResourceId("file:123")); |
162 EXPECT_FALSE(util::IsSpecialResourceId("folder:root")); | 161 EXPECT_FALSE(util::IsSpecialResourceId("folder:root")); |
163 EXPECT_FALSE(util::IsSpecialResourceId("folder:xyz")); | 162 EXPECT_FALSE(util::IsSpecialResourceId("folder:xyz")); |
164 | 163 |
165 EXPECT_TRUE(util::IsSpecialResourceId("<drive>")); | 164 EXPECT_TRUE(util::IsSpecialResourceId("<drive>")); |
166 EXPECT_TRUE(util::IsSpecialResourceId("<other>")); | 165 EXPECT_TRUE(util::IsSpecialResourceId("<other>")); |
167 } | 166 } |
168 | 167 |
169 } // namespace util | 168 } // namespace util |
170 } // namespace drive | 169 } // namespace drive |
OLD | NEW |