| 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 "chrome/browser/chromeos/file_system_provider/operations/observe_direct
ory.h" | 5 #include "chrome/browser/chromeos/file_system_provider/operations/observe_direct
ory.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/files/file.h" | 10 #include "base/files/file.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 const base::FilePath::CharType kDirectoryPath[] = "/kitty/and/puppy/happy"; | 30 const base::FilePath::CharType kDirectoryPath[] = "/kitty/and/puppy/happy"; |
| 31 | 31 |
| 32 } // namespace | 32 } // namespace |
| 33 | 33 |
| 34 class FileSystemProviderOperationsObserveDirectoryTest : public testing::Test { | 34 class FileSystemProviderOperationsObserveDirectoryTest : public testing::Test { |
| 35 protected: | 35 protected: |
| 36 FileSystemProviderOperationsObserveDirectoryTest() {} | 36 FileSystemProviderOperationsObserveDirectoryTest() {} |
| 37 virtual ~FileSystemProviderOperationsObserveDirectoryTest() {} | 37 virtual ~FileSystemProviderOperationsObserveDirectoryTest() {} |
| 38 | 38 |
| 39 virtual void SetUp() override { | 39 virtual void SetUp() override { |
| 40 file_system_info_ = | 40 file_system_info_ = ProvidedFileSystemInfo( |
| 41 ProvidedFileSystemInfo(kExtensionId, | 41 kExtensionId, |
| 42 kFileSystemId, | 42 MountOptions(kFileSystemId, "" /* display_name */), |
| 43 "" /* file_system_name */, | 43 base::FilePath()); |
| 44 false /* writable */, | |
| 45 false /* supports_notify_tag */, | |
| 46 base::FilePath() /* mount_path */); | |
| 47 } | 44 } |
| 48 | 45 |
| 49 ProvidedFileSystemInfo file_system_info_; | 46 ProvidedFileSystemInfo file_system_info_; |
| 50 }; | 47 }; |
| 51 | 48 |
| 52 TEST_F(FileSystemProviderOperationsObserveDirectoryTest, Execute) { | 49 TEST_F(FileSystemProviderOperationsObserveDirectoryTest, Execute) { |
| 53 using extensions::api::file_system_provider::ObserveDirectoryRequestedOptions; | 50 using extensions::api::file_system_provider::ObserveDirectoryRequestedOptions; |
| 54 | 51 |
| 55 util::LoggingDispatchEventImpl dispatcher(true /* dispatch_reply */); | 52 util::LoggingDispatchEventImpl dispatcher(true /* dispatch_reply */); |
| 56 util::StatusCallbackLog callback_log; | 53 util::StatusCallbackLog callback_log; |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 observe_directory.OnError(kRequestId, | 143 observe_directory.OnError(kRequestId, |
| 147 scoped_ptr<RequestValue>(new RequestValue()), | 144 scoped_ptr<RequestValue>(new RequestValue()), |
| 148 base::File::FILE_ERROR_TOO_MANY_OPENED); | 145 base::File::FILE_ERROR_TOO_MANY_OPENED); |
| 149 ASSERT_EQ(1u, callback_log.size()); | 146 ASSERT_EQ(1u, callback_log.size()); |
| 150 EXPECT_EQ(base::File::FILE_ERROR_TOO_MANY_OPENED, callback_log[0]); | 147 EXPECT_EQ(base::File::FILE_ERROR_TOO_MANY_OPENED, callback_log[0]); |
| 151 } | 148 } |
| 152 | 149 |
| 153 } // namespace operations | 150 } // namespace operations |
| 154 } // namespace file_system_provider | 151 } // namespace file_system_provider |
| 155 } // namespace chromeos | 152 } // namespace chromeos |
| OLD | NEW |