[M120 Migration][VD] Enable direct rendering for TVPlus
[platform/framework/web/chromium-efl.git] / components / storage_monitor / test_media_transfer_protocol_manager_chromeos.cc
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.
4
5 #include "components/storage_monitor/test_media_transfer_protocol_manager_chromeos.h"
6
7 #include <memory>
8 #include <utility>
9 #include <vector>
10
11 #include "base/no_destructor.h"
12 #include "services/device/public/mojom/mtp_file_entry.mojom.h"
13 #include "services/device/public/mojom/mtp_storage_info.mojom.h"
14
15 namespace storage_monitor {
16
17 // static
18 TestMediaTransferProtocolManagerChromeOS*
19 TestMediaTransferProtocolManagerChromeOS::GetFakeMtpManager() {
20   static base::NoDestructor<TestMediaTransferProtocolManagerChromeOS>
21       fake_mtp_manager;
22   return fake_mtp_manager.get();
23 }
24
25 TestMediaTransferProtocolManagerChromeOS::
26     TestMediaTransferProtocolManagerChromeOS() {}
27
28 TestMediaTransferProtocolManagerChromeOS::
29     ~TestMediaTransferProtocolManagerChromeOS() {}
30
31 void TestMediaTransferProtocolManagerChromeOS::AddReceiver(
32     mojo::PendingReceiver<device::mojom::MtpManager> receiver) {
33   receivers_.Add(this, std::move(receiver));
34 }
35
36 void TestMediaTransferProtocolManagerChromeOS::EnumerateStoragesAndSetClient(
37     mojo::PendingAssociatedRemote<device::mojom::MtpManagerClient> client,
38     EnumerateStoragesAndSetClientCallback callback) {
39   std::move(callback).Run(std::vector<device::mojom::MtpStorageInfoPtr>());
40 }
41
42 void TestMediaTransferProtocolManagerChromeOS::GetStorageInfo(
43     const std::string& storage_name,
44     GetStorageInfoCallback callback) {
45   std::move(callback).Run(nullptr);
46 }
47
48 void TestMediaTransferProtocolManagerChromeOS::GetStorageInfoFromDevice(
49     const std::string& storage_name,
50     GetStorageInfoFromDeviceCallback callback) {
51   std::move(callback).Run(device::mojom::MtpStorageInfo::New(),
52                           true /* error */);
53 }
54
55 void TestMediaTransferProtocolManagerChromeOS::OpenStorage(
56     const std::string& storage_name,
57     const std::string& mode,
58     OpenStorageCallback callback) {
59   std::move(callback).Run("", true);
60 }
61
62 void TestMediaTransferProtocolManagerChromeOS::CloseStorage(
63     const std::string& storage_handle,
64     CloseStorageCallback callback) {
65   std::move(callback).Run(true);
66 }
67
68 void TestMediaTransferProtocolManagerChromeOS::CreateDirectory(
69     const std::string& storage_handle,
70     uint32_t parent_id,
71     const std::string& directory_name,
72     CreateDirectoryCallback callback) {
73   std::move(callback).Run(true /* error */);
74 }
75
76 void TestMediaTransferProtocolManagerChromeOS::ReadDirectoryEntryIds(
77     const std::string& storage_handle,
78     uint32_t file_id,
79     ReadDirectoryEntryIdsCallback callback) {
80   std::move(callback).Run(std::vector<uint32_t>(), /*error=*/true);
81 }
82
83 void TestMediaTransferProtocolManagerChromeOS::ReadFileChunk(
84     const std::string& storage_handle,
85     uint32_t file_id,
86     uint32_t offset,
87     uint32_t count,
88     ReadFileChunkCallback callback) {
89   std::move(callback).Run(std::string(), true);
90 }
91
92 void TestMediaTransferProtocolManagerChromeOS::GetFileInfo(
93     const std::string& storage_handle,
94     const std::vector<uint32_t>& file_ids,
95     GetFileInfoCallback callback) {
96   std::move(callback).Run(std::vector<device::mojom::MtpFileEntryPtr>(), true);
97 }
98
99 void TestMediaTransferProtocolManagerChromeOS::RenameObject(
100     const std::string& storage_handle,
101     uint32_t object_id,
102     const std::string& new_name,
103     RenameObjectCallback callback) {
104   std::move(callback).Run(true /* error */);
105 }
106
107 void TestMediaTransferProtocolManagerChromeOS::CopyFileFromLocal(
108     const std::string& storage_handle,
109     int64_t source_file_descriptor,
110     uint32_t parent_id,
111     const std::string& file_name,
112     CopyFileFromLocalCallback callback) {
113   std::move(callback).Run(true /* error */);
114 }
115
116 void TestMediaTransferProtocolManagerChromeOS::DeleteObject(
117     const std::string& storage_handle,
118     uint32_t object_id,
119     DeleteObjectCallback callback) {
120   std::move(callback).Run(true /* error */);
121 }
122
123 }  // namespace storage_monitor