| OLD | NEW |
| 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 <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "base/files/scoped_temp_dir.h" | 9 #include "base/files/scoped_temp_dir.h" |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 file_system_context_ = NULL; | 45 file_system_context_ = NULL; |
| 46 base::MessageLoop::current()->RunUntilIdle(); | 46 base::MessageLoop::current()->RunUntilIdle(); |
| 47 } | 47 } |
| 48 | 48 |
| 49 protected: | 49 protected: |
| 50 FileSystemOperationContext* NewContext() { | 50 FileSystemOperationContext* NewContext() { |
| 51 FileSystemOperationContext* context = | 51 FileSystemOperationContext* context = |
| 52 new FileSystemOperationContext(file_system_context_); | 52 new FileSystemOperationContext(file_system_context_); |
| 53 context->set_update_observers( | 53 context->set_update_observers( |
| 54 *file_system_context_->GetUpdateObservers(kFileSystemType)); | 54 *file_system_context_->GetUpdateObservers(kFileSystemType)); |
| 55 context->set_root_path(data_dir_.path()); |
| 55 return context; | 56 return context; |
| 56 } | 57 } |
| 57 | 58 |
| 58 LocalFileUtil* file_util() { | 59 LocalFileUtil* file_util() { |
| 59 return static_cast<LocalFileUtil*>( | 60 return static_cast<LocalFileUtil*>( |
| 60 file_system_context_->GetFileUtil(kFileSystemType)); | 61 file_system_context_->GetFileUtil(kFileSystemType)); |
| 61 } | 62 } |
| 62 | 63 |
| 63 FileSystemURL CreateURL(const std::string& file_name) { | 64 FileSystemURL CreateURL(const std::string& file_name) { |
| 64 return file_system_context_->CreateCrackedFileSystemURL( | 65 return file_system_context_->CreateCrackedFileSystemURL( |
| (...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 377 CreateURL(from_dir), | 378 CreateURL(from_dir), |
| 378 CreateURL(to_dir))); | 379 CreateURL(to_dir))); |
| 379 | 380 |
| 380 EXPECT_FALSE(DirectoryExists(from_dir)); | 381 EXPECT_FALSE(DirectoryExists(from_dir)); |
| 381 EXPECT_TRUE(DirectoryExists(to_dir)); | 382 EXPECT_TRUE(DirectoryExists(to_dir)); |
| 382 EXPECT_TRUE(FileExists(to_file)); | 383 EXPECT_TRUE(FileExists(to_file)); |
| 383 EXPECT_EQ(1020, GetSize(to_file)); | 384 EXPECT_EQ(1020, GetSize(to_file)); |
| 384 } | 385 } |
| 385 | 386 |
| 386 } // namespace fileapi | 387 } // namespace fileapi |
| OLD | NEW |