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

Side by Side Diff: chrome/browser/chromeos/drive/drive_file_system_util_unittest.cc

Issue 13586012: drive: Enable a hook to update the default download directory. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add comment. 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/chromeos/drive/drive_file_system_util.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/drive/drive_file_system_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698