1 // Copyright 2014 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef COMPONENTS_STORAGE_MONITOR_TEST_MEDIA_TRANSFER_PROTOCOL_MANAGER_CHROMEOS_H_
6 #define COMPONENTS_STORAGE_MONITOR_TEST_MEDIA_TRANSFER_PROTOCOL_MANAGER_CHROMEOS_H_
13 #include "mojo/public/cpp/bindings/pending_associated_remote.h"
14 #include "mojo/public/cpp/bindings/pending_receiver.h"
15 #include "mojo/public/cpp/bindings/receiver_set.h"
16 #include "services/device/public/mojom/mtp_manager.mojom.h"
18 namespace storage_monitor {
20 // A dummy MediaTransferProtocolManager implementation.
21 class TestMediaTransferProtocolManagerChromeOS
22 : public device::mojom::MtpManager {
24 static TestMediaTransferProtocolManagerChromeOS* GetFakeMtpManager();
25 TestMediaTransferProtocolManagerChromeOS();
27 TestMediaTransferProtocolManagerChromeOS(
28 const TestMediaTransferProtocolManagerChromeOS&) = delete;
29 TestMediaTransferProtocolManagerChromeOS& operator=(
30 const TestMediaTransferProtocolManagerChromeOS&) = delete;
32 ~TestMediaTransferProtocolManagerChromeOS() override;
34 void AddReceiver(mojo::PendingReceiver<device::mojom::MtpManager> receiver);
37 // device::mojom::MtpManager implementation.
38 void EnumerateStoragesAndSetClient(
39 mojo::PendingAssociatedRemote<device::mojom::MtpManagerClient> client,
40 EnumerateStoragesAndSetClientCallback callback) override;
41 void GetStorageInfo(const std::string& storage_name,
42 GetStorageInfoCallback callback) override;
43 void GetStorageInfoFromDevice(
44 const std::string& storage_name,
45 GetStorageInfoFromDeviceCallback callback) override;
46 void OpenStorage(const std::string& storage_name,
47 const std::string& mode,
48 OpenStorageCallback callback) override;
49 void CloseStorage(const std::string& storage_handle,
50 CloseStorageCallback callback) override;
51 void CreateDirectory(const std::string& storage_handle,
53 const std::string& directory_name,
54 CreateDirectoryCallback callback) override;
55 void ReadDirectoryEntryIds(const std::string& storage_handle,
57 ReadDirectoryEntryIdsCallback callback) override;
58 void ReadFileChunk(const std::string& storage_handle,
62 ReadFileChunkCallback callback) override;
63 void GetFileInfo(const std::string& storage_handle,
64 const std::vector<uint32_t>& file_ids,
65 GetFileInfoCallback callback) override;
66 void RenameObject(const std::string& storage_handle,
68 const std::string& new_name,
69 RenameObjectCallback callback) override;
70 void CopyFileFromLocal(const std::string& storage_handle,
71 int64_t source_file_descriptor,
73 const std::string& file_name,
74 CopyFileFromLocalCallback callback) override;
75 void DeleteObject(const std::string& storage_handle,
77 DeleteObjectCallback callback) override;
79 mojo::ReceiverSet<device::mojom::MtpManager> receivers_;
82 } // namespace storage_monitor
84 #endif // COMPONENTS_STORAGE_MONITOR_TEST_MEDIA_TRANSFER_PROTOCOL_MANAGER_CHROMEOS_H_