1 // Copyright 2017 The Chromium Authors. All rights reserved. 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/offline_pages/core/prefetch/test_download_client.h" 6 7 #include "components/offline_pages/core/prefetch/prefetch_downloader.h" 8 9 namespace offline_pages { 10 TestDownloadClient(PrefetchDownloader * downloader)11TestDownloadClient::TestDownloadClient(PrefetchDownloader* downloader) 12 : downloader_(downloader) {} 13 OnDownloadFailed(const std::string & guid,const download::CompletionInfo & completion_info,download::Client::FailureReason reason)14void TestDownloadClient::OnDownloadFailed( 15 const std::string& guid, 16 const download::CompletionInfo& completion_info, 17 download::Client::FailureReason reason) { 18 downloader_->OnDownloadFailed(guid); 19 } 20 OnDownloadSucceeded(const std::string & guid,const download::CompletionInfo & completion_info)21void TestDownloadClient::OnDownloadSucceeded( 22 const std::string& guid, 23 const download::CompletionInfo& completion_info) { 24 downloader_->OnDownloadSucceeded(guid, completion_info.path, 25 completion_info.bytes_downloaded); 26 } 27 28 } // namespace offline_pages 29