1 /* 2 * Copyright (c) 2021 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #include "base/log/log.h" 17 #include "base/network/download_manager.h" 18 #include "base/utils/singleton.h" 19 #include "base/utils/utils.h" 20 21 namespace OHOS::Ace { 22 namespace { 23 class MockDownloadManager final : public DownloadManager, public Singleton<MockDownloadManager> { 24 DECLARE_SINGLETON(MockDownloadManager); 25 ACE_DISALLOW_MOVE(MockDownloadManager); 26 27 public: Download(const std::string & url,std::vector<uint8_t> & dataOut)28 bool Download(const std::string& url, std::vector<uint8_t>& dataOut) override 29 { 30 return false; 31 } 32 }; 33 34 MockDownloadManager::MockDownloadManager() = default; 35 36 MockDownloadManager::~MockDownloadManager() = default; 37 38 } // namespace 39 GetInstance()40DownloadManager& DownloadManager::GetInstance() 41 { 42 return Singleton<MockDownloadManager>::GetInstance(); 43 } 44 } // namespace OHOS::Ace 45