| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #include <string> | 5 #include <string> |
| 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" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 | 36 |
| 37 const GURL kOrigin("http://foo/"); | 37 const GURL kOrigin("http://foo/"); |
| 38 const storage::FileSystemType kFileSystemType = storage::kFileSystemTypeTest; | 38 const storage::FileSystemType kFileSystemType = storage::kFileSystemTypeTest; |
| 39 | 39 |
| 40 } // namespace | 40 } // namespace |
| 41 | 41 |
| 42 class LocalFileUtilTest : public testing::Test { | 42 class LocalFileUtilTest : public testing::Test { |
| 43 public: | 43 public: |
| 44 LocalFileUtilTest() {} | 44 LocalFileUtilTest() {} |
| 45 | 45 |
| 46 virtual void SetUp() { | 46 void SetUp() override { |
| 47 ASSERT_TRUE(data_dir_.CreateUniqueTempDir()); | 47 ASSERT_TRUE(data_dir_.CreateUniqueTempDir()); |
| 48 file_system_context_ = CreateFileSystemContextForTesting( | 48 file_system_context_ = CreateFileSystemContextForTesting( |
| 49 NULL, data_dir_.path()); | 49 NULL, data_dir_.path()); |
| 50 } | 50 } |
| 51 | 51 |
| 52 virtual void TearDown() { | 52 void TearDown() override { |
| 53 file_system_context_ = NULL; | 53 file_system_context_ = NULL; |
| 54 base::RunLoop().RunUntilIdle(); | 54 base::RunLoop().RunUntilIdle(); |
| 55 } | 55 } |
| 56 | 56 |
| 57 protected: | 57 protected: |
| 58 FileSystemOperationContext* NewContext() { | 58 FileSystemOperationContext* NewContext() { |
| 59 FileSystemOperationContext* context = | 59 FileSystemOperationContext* context = |
| 60 new FileSystemOperationContext(file_system_context_.get()); | 60 new FileSystemOperationContext(file_system_context_.get()); |
| 61 context->set_update_observers( | 61 context->set_update_observers( |
| 62 *file_system_context_->GetUpdateObservers(kFileSystemType)); | 62 *file_system_context_->GetUpdateObservers(kFileSystemType)); |
| (...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 368 CreateURL(from_dir), | 368 CreateURL(from_dir), |
| 369 CreateURL(to_dir))); | 369 CreateURL(to_dir))); |
| 370 | 370 |
| 371 EXPECT_FALSE(DirectoryExists(from_dir)); | 371 EXPECT_FALSE(DirectoryExists(from_dir)); |
| 372 EXPECT_TRUE(DirectoryExists(to_dir)); | 372 EXPECT_TRUE(DirectoryExists(to_dir)); |
| 373 EXPECT_TRUE(FileExists(to_file)); | 373 EXPECT_TRUE(FileExists(to_file)); |
| 374 EXPECT_EQ(1020, GetSize(to_file)); | 374 EXPECT_EQ(1020, GetSize(to_file)); |
| 375 } | 375 } |
| 376 | 376 |
| 377 } // namespace content | 377 } // namespace content |
| OLD | NEW |