| OLD | NEW |
| 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 <set> | 5 #include <set> |
| 6 | 6 |
| 7 #include "base/files/file.h" | 7 #include "base/files/file.h" |
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
| 10 #include "base/files/scoped_temp_dir.h" | 10 #include "base/files/scoped_temp_dir.h" |
| 11 #include "storage/browser/fileapi/native_file_util.h" | 11 #include "storage/browser/fileapi/native_file_util.h" |
| 12 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
| 13 | 13 |
| 14 using storage::FileSystemFileUtil; | 14 using storage::FileSystemFileUtil; |
| 15 using storage::FileSystemOperation; | 15 using storage::FileSystemOperation; |
| 16 using storage::NativeFileUtil; | 16 using storage::NativeFileUtil; |
| 17 | 17 |
| 18 namespace content { | 18 namespace content { |
| 19 | 19 |
| 20 class NativeFileUtilTest : public testing::Test { | 20 class NativeFileUtilTest : public testing::Test { |
| 21 public: | 21 public: |
| 22 NativeFileUtilTest() {} | 22 NativeFileUtilTest() {} |
| 23 | 23 |
| 24 virtual void SetUp() { | 24 void SetUp() override { ASSERT_TRUE(data_dir_.CreateUniqueTempDir()); } |
| 25 ASSERT_TRUE(data_dir_.CreateUniqueTempDir()); | |
| 26 } | |
| 27 | 25 |
| 28 protected: | 26 protected: |
| 29 base::FilePath Path() { | 27 base::FilePath Path() { |
| 30 return data_dir_.path(); | 28 return data_dir_.path(); |
| 31 } | 29 } |
| 32 | 30 |
| 33 base::FilePath Path(const char* file_name) { | 31 base::FilePath Path(const char* file_name) { |
| 34 return data_dir_.path().AppendASCII(file_name); | 32 return data_dir_.path().AppendASCII(file_name); |
| 35 } | 33 } |
| 36 | 34 |
| (...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 400 FileSystemOperation::OPTION_PRESERVE_LAST_MODIFIED, | 398 FileSystemOperation::OPTION_PRESERVE_LAST_MODIFIED, |
| 401 NativeFileUtil::MOVE)); | 399 NativeFileUtil::MOVE)); |
| 402 | 400 |
| 403 ASSERT_TRUE(FileExists(to_file3)); | 401 ASSERT_TRUE(FileExists(to_file3)); |
| 404 ASSERT_EQ(base::File::FILE_OK, | 402 ASSERT_EQ(base::File::FILE_OK, |
| 405 NativeFileUtil::GetFileInfo(to_file2, &file_info2)); | 403 NativeFileUtil::GetFileInfo(to_file2, &file_info2)); |
| 406 EXPECT_EQ(file_info1.last_modified, file_info2.last_modified); | 404 EXPECT_EQ(file_info1.last_modified, file_info2.last_modified); |
| 407 } | 405 } |
| 408 | 406 |
| 409 } // namespace content | 407 } // namespace content |
| OLD | NEW |