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

Side by Side Diff: content/browser/fileapi/native_file_util_unittest.cc

Issue 2316043002: //content: Change ScopedTempDir::path() to GetPath() (Closed)
Patch Set: Just rebased Created 4 years, 3 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 <stdint.h> 5 #include <stdint.h>
6 6
7 #include <memory> 7 #include <memory>
8 #include <set> 8 #include <set>
9 9
10 #include "base/files/file.h" 10 #include "base/files/file.h"
(...skipping 10 matching lines...) Expand all
21 21
22 namespace content { 22 namespace content {
23 23
24 class NativeFileUtilTest : public testing::Test { 24 class NativeFileUtilTest : public testing::Test {
25 public: 25 public:
26 NativeFileUtilTest() {} 26 NativeFileUtilTest() {}
27 27
28 void SetUp() override { ASSERT_TRUE(data_dir_.CreateUniqueTempDir()); } 28 void SetUp() override { ASSERT_TRUE(data_dir_.CreateUniqueTempDir()); }
29 29
30 protected: 30 protected:
31 base::FilePath Path() { 31 base::FilePath Path() { return data_dir_.GetPath(); }
32 return data_dir_.path();
33 }
34 32
35 base::FilePath Path(const char* file_name) { 33 base::FilePath Path(const char* file_name) {
36 return data_dir_.path().AppendASCII(file_name); 34 return data_dir_.GetPath().AppendASCII(file_name);
37 } 35 }
38 36
39 bool FileExists(const base::FilePath& path) { 37 bool FileExists(const base::FilePath& path) {
40 return base::PathExists(path) && 38 return base::PathExists(path) &&
41 !base::DirectoryExists(path); 39 !base::DirectoryExists(path);
42 } 40 }
43 41
44 int64_t GetSize(const base::FilePath& path) { 42 int64_t GetSize(const base::FilePath& path) {
45 base::File::Info info; 43 base::File::Info info;
46 base::GetFileInfo(path, &info); 44 base::GetFileInfo(path, &info);
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after
402 FileSystemOperation::OPTION_PRESERVE_LAST_MODIFIED, 400 FileSystemOperation::OPTION_PRESERVE_LAST_MODIFIED,
403 NativeFileUtil::MOVE)); 401 NativeFileUtil::MOVE));
404 402
405 ASSERT_TRUE(FileExists(to_file3)); 403 ASSERT_TRUE(FileExists(to_file3));
406 ASSERT_EQ(base::File::FILE_OK, 404 ASSERT_EQ(base::File::FILE_OK,
407 NativeFileUtil::GetFileInfo(to_file2, &file_info2)); 405 NativeFileUtil::GetFileInfo(to_file2, &file_info2));
408 EXPECT_EQ(file_info1.last_modified, file_info2.last_modified); 406 EXPECT_EQ(file_info1.last_modified, file_info2.last_modified);
409 } 407 }
410 408
411 } // namespace content 409 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/fileapi/local_file_util_unittest.cc ('k') | content/browser/fileapi/obfuscated_file_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698