chromium/content/public/test/fake_download_item.cc

// Copyright 2016 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "content/public/test/fake_download_item.h"

#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/notreached.h"
#include "components/download/public/common/download_danger_type.h"
#include "net/http/http_response_headers.h"

namespace content {

FakeDownloadItem::FakeDownloadItem() = default;

FakeDownloadItem::~FakeDownloadItem() {}

void FakeDownloadItem::AddObserver(Observer* observer) {}

void FakeDownloadItem::RemoveObserver(Observer* observer) {}

void FakeDownloadItem::NotifyDownloadDestroyed() {}

void FakeDownloadItem::NotifyDownloadRemoved() {}

void FakeDownloadItem::NotifyDownloadUpdated() {}

void FakeDownloadItem::UpdateObservers() {}

void FakeDownloadItem::SetId(uint32_t id) {}

uint32_t FakeDownloadItem::GetId() const {}

void FakeDownloadItem::SetGuid(const std::string& guid) {}

const std::string& FakeDownloadItem::GetGuid() const {}

void FakeDownloadItem::SetURL(const GURL& url) {}

const GURL& FakeDownloadItem::GetURL() const {}

void FakeDownloadItem::SetUrlChain(const std::vector<GURL>& url_chain) {}

const std::vector<GURL>& FakeDownloadItem::GetUrlChain() const {}

void FakeDownloadItem::SetLastReason(
    download::DownloadInterruptReason last_reason) {}

download::DownloadInterruptReason FakeDownloadItem::GetLastReason() const {}

void FakeDownloadItem::SetTargetFilePath(const base::FilePath& file_path) {}

const base::FilePath& FakeDownloadItem::GetTargetFilePath() const {}

void FakeDownloadItem::SetFileExternallyRemoved(
    bool is_file_externally_removed) {}

bool FakeDownloadItem::GetFileExternallyRemoved() const {}

void FakeDownloadItem::SetStartTime(base::Time start_time) {}

base::Time FakeDownloadItem::GetStartTime() const {}

void FakeDownloadItem::SetEndTime(base::Time end_time) {}

base::Time FakeDownloadItem::GetEndTime() const {}

void FakeDownloadItem::SetState(const DownloadState& state) {}

download::DownloadItem::DownloadState FakeDownloadItem::GetState() const {}

void FakeDownloadItem::SetResponseHeaders(
    scoped_refptr<const net::HttpResponseHeaders> response_headers) {}

const scoped_refptr<const net::HttpResponseHeaders>&
FakeDownloadItem::GetResponseHeaders() const {}

void FakeDownloadItem::SetMimeType(const std::string& mime_type) {}

std::string FakeDownloadItem::GetMimeType() const {}

void FakeDownloadItem::SetOriginalUrl(const GURL& url) {}

void FakeDownloadItem::SetTabUrl(const GURL& url) {}

const GURL& FakeDownloadItem::GetOriginalUrl() const {}

void FakeDownloadItem::SetReceivedBytes(int64_t received_bytes) {}

void FakeDownloadItem::SetTotalBytes(int64_t total_bytes) {}

int64_t FakeDownloadItem::GetReceivedBytes() const {}

void FakeDownloadItem::SetLastAccessTime(base::Time time) {}

base::Time FakeDownloadItem::GetLastAccessTime() const {}

void FakeDownloadItem::SetIsTransient(bool is_transient) {}

bool FakeDownloadItem::IsTransient() const {}

void FakeDownloadItem::SetIsParallelDownload(bool is_parallel_download) {}

bool FakeDownloadItem::IsParallelDownload() const {}

download::DownloadItem::DownloadCreationType
FakeDownloadItem::GetDownloadCreationType() const {}

::network::mojom::CredentialsMode FakeDownloadItem::GetCredentialsMode() const {}

const std::optional<net::IsolationInfo>& FakeDownloadItem::GetIsolationInfo()
    const {}

void FakeDownloadItem::SetIsDone(bool is_done) {}

bool FakeDownloadItem::IsDone() const {}

void FakeDownloadItem::SetETag(const std::string& etag) {}

const std::string& FakeDownloadItem::GetETag() const {}

void FakeDownloadItem::SetLastModifiedTime(
    const std::string& last_modified_time) {}

void FakeDownloadItem::SetHash(const std::string& hash) {}

const std::string& FakeDownloadItem::GetLastModifiedTime() const {}

void FakeDownloadItem::SetPercentComplete(int percent_complete) {}

int FakeDownloadItem::PercentComplete() const {}

void FakeDownloadItem::SetDummyFilePath(const base::FilePath& file_path) {}

void FakeDownloadItem::SetIsDangerous(bool is_dangerous) {}

void FakeDownloadItem::SetIsInsecure(bool is_insecure) {}

void FakeDownloadItem::SetDangerType(download::DownloadDangerType danger_type) {}

void FakeDownloadItem::SetInsecureDownloadStatus(
    download::DownloadItem::InsecureDownloadStatus insecure_download_status) {}

bool FakeDownloadItem::GetOpenWhenComplete() const {}

void FakeDownloadItem::SetOpenWhenComplete(bool open) {}

// The methods below are not supported and are not expected to be called.
void FakeDownloadItem::ValidateDangerousDownload() {}

void FakeDownloadItem::ValidateInsecureDownload() {}

void FakeDownloadItem::StealDangerousDownload(bool delete_file_afterward,
                                              AcquireFileCallback callback) {}

void FakeDownloadItem::Pause() {}

void FakeDownloadItem::Resume(bool user_resume) {}

void FakeDownloadItem::Cancel(bool user_cancel) {}

void FakeDownloadItem::Remove() {}

void FakeDownloadItem::OpenDownload() {}

void FakeDownloadItem::ShowDownloadInShell() {}

void FakeDownloadItem::Rename(const base::FilePath& name,
                              RenameDownloadCallback callback) {}

void FakeDownloadItem::OnAsyncScanningCompleted(
    download::DownloadDangerType danger_type) {}

bool FakeDownloadItem::IsPaused() const {}

bool FakeDownloadItem::AllowMetered() const {}

bool FakeDownloadItem::IsTemporary() const {}

bool FakeDownloadItem::RequireSafetyChecks() const {}

bool FakeDownloadItem::CanResume() const {}

int64_t FakeDownloadItem::GetBytesWasted() const {}

int32_t FakeDownloadItem::GetAutoResumeCount() const {}

const GURL& FakeDownloadItem::GetReferrerUrl() const {}

const std::string& FakeDownloadItem::GetSerializedEmbedderDownloadData() const {}

const GURL& FakeDownloadItem::GetTabUrl() const {}

const GURL& FakeDownloadItem::GetTabReferrerUrl() const {}

const std::optional<url::Origin>& FakeDownloadItem::GetRequestInitiator()
    const {}

std::string FakeDownloadItem::GetSuggestedFilename() const {}

std::string FakeDownloadItem::GetContentDisposition() const {}

std::string FakeDownloadItem::GetOriginalMimeType() const {}

std::string FakeDownloadItem::GetRemoteAddress() const {}

bool FakeDownloadItem::HasUserGesture() const {}

ui::PageTransition FakeDownloadItem::GetTransitionType() const {}

bool FakeDownloadItem::IsSavePackageDownload() const {}

download::DownloadSource FakeDownloadItem::GetDownloadSource() const {}

const base::FilePath& FakeDownloadItem::GetFullPath() const {}

const base::FilePath& FakeDownloadItem::GetForcedFilePath() const {}

base::FilePath FakeDownloadItem::GetTemporaryFilePath() const {}

base::FilePath FakeDownloadItem::GetFileNameToReportUser() const {}

download::DownloadItem::TargetDisposition
FakeDownloadItem::GetTargetDisposition() const {}

const std::string& FakeDownloadItem::GetHash() const {}

void FakeDownloadItem::DeleteFile(base::OnceCallback<void(bool)> callback) {}

download::DownloadFile* FakeDownloadItem::GetDownloadFile() {}

download::DownloadItemRenameHandler* FakeDownloadItem::GetRenameHandler() {}

#if BUILDFLAG(IS_ANDROID)
bool FakeDownloadItem::IsFromExternalApp() {
  return false;
}

bool FakeDownloadItem::IsMustDownload() {
  return false;
}
#endif  // BUILDFLAG(IS_ANDROID)

bool FakeDownloadItem::IsDangerous() const {}

bool FakeDownloadItem::IsInsecure() const {}

download::DownloadDangerType FakeDownloadItem::GetDangerType() const {}

download::DownloadItem::InsecureDownloadStatus
FakeDownloadItem::GetInsecureDownloadStatus() const {}

bool FakeDownloadItem::TimeRemaining(base::TimeDelta* remaining) const {}

int64_t FakeDownloadItem::CurrentSpeed() const {}

bool FakeDownloadItem::AllDataSaved() const {}

int64_t FakeDownloadItem::GetTotalBytes() const {}

const std::vector<download::DownloadItem::ReceivedSlice>&
FakeDownloadItem::GetReceivedSlices() const {}

int64_t FakeDownloadItem::GetUploadedBytes() const {}

bool FakeDownloadItem::CanShowInFolder() {}

bool FakeDownloadItem::CanOpenDownload() {}

bool FakeDownloadItem::ShouldOpenFileBasedOnExtension() {}

bool FakeDownloadItem::ShouldOpenFileByPolicyBasedOnExtension() {}

bool FakeDownloadItem::GetAutoOpened() {}

bool FakeDownloadItem::GetOpened() const {}

void FakeDownloadItem::OnContentCheckCompleted(
    download::DownloadDangerType danger_type,
    download::DownloadInterruptReason reason) {}

void FakeDownloadItem::SetOpened(bool opened) {}

void FakeDownloadItem::SetDisplayName(const base::FilePath& name) {}

std::string FakeDownloadItem::DebugString(bool verbose) const {}

void FakeDownloadItem::SimulateErrorForTesting(
    download::DownloadInterruptReason reason) {}

}  // namespace content