| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "webkit/fileapi/file_system_operation.h" | 5 #include "webkit/fileapi/file_system_operation.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "base/scoped_ptr.h" | 9 #include "base/scoped_ptr.h" |
| 10 #include "base/scoped_temp_dir.h" | 10 #include "base/scoped_temp_dir.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 info_ = info; | 41 info_ = info; |
| 42 status_ = kFileOperationSucceeded; | 42 status_ = kFileOperationSucceeded; |
| 43 } | 43 } |
| 44 | 44 |
| 45 virtual void DidReadDirectory( | 45 virtual void DidReadDirectory( |
| 46 const std::vector<base::file_util_proxy::Entry>& entries, | 46 const std::vector<base::file_util_proxy::Entry>& entries, |
| 47 bool /* has_more */) { | 47 bool /* has_more */) { |
| 48 entries_ = entries; | 48 entries_ = entries; |
| 49 } | 49 } |
| 50 | 50 |
| 51 virtual void DidOpenFileSystem(const string16&, const FilePath&) { | 51 virtual void DidOpenFileSystem(const std::string&, const FilePath&) { |
| 52 NOTREACHED(); | 52 NOTREACHED(); |
| 53 } | 53 } |
| 54 | 54 |
| 55 // Helpers for testing. | 55 // Helpers for testing. |
| 56 int status() const { return status_; } | 56 int status() const { return status_; } |
| 57 int request_id() const { return request_id_; } | 57 int request_id() const { return request_id_; } |
| 58 const base::PlatformFileInfo& info() const { return info_; } | 58 const base::PlatformFileInfo& info() const { return info_; } |
| 59 const std::vector<base::file_util_proxy::Entry>& entries() const { | 59 const std::vector<base::file_util_proxy::Entry>& entries() const { |
| 60 return entries_; | 60 return entries_; |
| 61 } | 61 } |
| (...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 546 ScopedTempDir empty_dir; | 546 ScopedTempDir empty_dir; |
| 547 ASSERT_TRUE(empty_dir.CreateUniqueTempDir()); | 547 ASSERT_TRUE(empty_dir.CreateUniqueTempDir()); |
| 548 EXPECT_TRUE(file_util::DirectoryExists(empty_dir.path())); | 548 EXPECT_TRUE(file_util::DirectoryExists(empty_dir.path())); |
| 549 | 549 |
| 550 operation()->Remove(empty_dir.path()); | 550 operation()->Remove(empty_dir.path()); |
| 551 MessageLoop::current()->RunAllPending(); | 551 MessageLoop::current()->RunAllPending(); |
| 552 EXPECT_EQ(kFileOperationSucceeded, mock_dispatcher_->status()); | 552 EXPECT_EQ(kFileOperationSucceeded, mock_dispatcher_->status()); |
| 553 EXPECT_FALSE(file_util::DirectoryExists(empty_dir.path())); | 553 EXPECT_FALSE(file_util::DirectoryExists(empty_dir.path())); |
| 554 EXPECT_EQ(request_id_, mock_dispatcher_->request_id()); | 554 EXPECT_EQ(request_id_, mock_dispatcher_->request_id()); |
| 555 } | 555 } |
| OLD | NEW |