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

Side by Side Diff: chrome/browser/chromeos/file_manager/file_manager_browsertest.cc

Issue 100453006: Move Touch to base namespace, remove SetLastModifiedTime. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 // Browser test for basic Chrome OS file manager functionality: 5 // Browser test for basic Chrome OS file manager functionality:
6 // - The file list is updated when a file is added externally to the Downloads 6 // - The file list is updated when a file is added externally to the Downloads
7 // folder. 7 // folder.
8 // - Selecting a file and copy-pasting it with the keyboard copies the file. 8 // - Selecting a file and copy-pasting it with the keyboard copies the file.
9 // - Selecting a file and pressing delete deletes it. 9 // - Selecting a file and pressing delete deletes it.
10 10
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 break; 229 break;
230 } 230 }
231 ASSERT_TRUE(UpdateModifiedTime(entry)); 231 ASSERT_TRUE(UpdateModifiedTime(entry));
232 } 232 }
233 233
234 private: 234 private:
235 // Updates ModifiedTime of the entry and its parents by referring 235 // Updates ModifiedTime of the entry and its parents by referring
236 // TestEntryInfo. Returns true on success. 236 // TestEntryInfo. Returns true on success.
237 bool UpdateModifiedTime(const TestEntryInfo& entry) { 237 bool UpdateModifiedTime(const TestEntryInfo& entry) {
238 const base::FilePath path = local_path_.AppendASCII(entry.target_path); 238 const base::FilePath path = local_path_.AppendASCII(entry.target_path);
239 if (!file_util::SetLastModifiedTime(path, entry.last_modified_time)) 239 if (!base::TouchFile(path, entry.last_modified_time,
240 entry.last_modified_time))
240 return false; 241 return false;
241 242
242 // Update the modified time of parent directories because it may be also 243 // Update the modified time of parent directories because it may be also
243 // affected by the update of child items. 244 // affected by the update of child items.
244 if (path.DirName() != local_path_) { 245 if (path.DirName() != local_path_) {
245 const std::map<base::FilePath, const TestEntryInfo>::iterator it = 246 const std::map<base::FilePath, const TestEntryInfo>::iterator it =
246 entries_.find(path.DirName()); 247 entries_.find(path.DirName());
247 if (it == entries_.end()) 248 if (it == entries_.end())
248 return false; 249 return false;
249 return UpdateModifiedTime(it->second); 250 return UpdateModifiedTime(it->second);
(...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after
732 ::testing::Values(TestParameter(NOT_IN_GUEST_MODE, "searchBoxFocus"))); 733 ::testing::Values(TestParameter(NOT_IN_GUEST_MODE, "searchBoxFocus")));
733 734
734 INSTANTIATE_TEST_CASE_P( 735 INSTANTIATE_TEST_CASE_P(
735 Thumbnails, 736 Thumbnails,
736 FileManagerBrowserTest, 737 FileManagerBrowserTest,
737 ::testing::Values(TestParameter(NOT_IN_GUEST_MODE, "thumbnailsDownloads"), 738 ::testing::Values(TestParameter(NOT_IN_GUEST_MODE, "thumbnailsDownloads"),
738 TestParameter(IN_GUEST_MODE, "thumbnailsDownloads"))); 739 TestParameter(IN_GUEST_MODE, "thumbnailsDownloads")));
739 740
740 } // namespace 741 } // namespace
741 } // namespace file_manager 742 } // namespace file_manager
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698