#include "content/public/test/download_test_observer.h"
#include "base/memory/raw_ptr.h"
#include <vector>
#include "base/check_op.h"
#include "base/containers/contains.h"
#include "base/functional/bind.h"
#include "base/notreached.h"
#include "base/run_loop.h"
#include "components/download/public/common/download_url_parameters.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/download_manager.h"
#include "content/public/test/test_utils.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace content {
DownloadUpdatedObserver::DownloadUpdatedObserver(
download::DownloadItem* item,
DownloadUpdatedObserver::EventFilter filter)
: … { … }
DownloadUpdatedObserver::~DownloadUpdatedObserver() { … }
bool DownloadUpdatedObserver::WaitForEvent() { … }
void DownloadUpdatedObserver::OnDownloadUpdated(download::DownloadItem* item) { … }
void DownloadUpdatedObserver::OnDownloadDestroyed(
download::DownloadItem* item) { … }
DownloadTestObserver::DownloadTestObserver(
DownloadManager* download_manager,
size_t wait_count,
DangerousDownloadAction dangerous_download_action)
: … { … }
DownloadTestObserver::~DownloadTestObserver() { … }
void DownloadTestObserver::Init() { … }
void DownloadTestObserver::ManagerGoingDown(DownloadManager* manager) { … }
void DownloadTestObserver::WaitForFinished() { … }
bool DownloadTestObserver::IsFinished() const { … }
void DownloadTestObserver::OnDownloadCreated(DownloadManager* manager,
download::DownloadItem* item) { … }
void DownloadTestObserver::OnDownloadDestroyed(
download::DownloadItem* download) { … }
void DownloadTestObserver::OnDownloadUpdated(download::DownloadItem* download) { … }
size_t DownloadTestObserver::NumDangerousDownloadsSeen() const { … }
size_t DownloadTestObserver::NumDownloadsSeenInState(
download::DownloadItem::DownloadState state) const { … }
void DownloadTestObserver::DownloadInFinalState(
download::DownloadItem* download) { … }
void DownloadTestObserver::SignalIfFinished() { … }
void DownloadTestObserver::AcceptDangerousDownload(uint32_t download_id) { … }
void DownloadTestObserver::DenyDangerousDownload(uint32_t download_id) { … }
DownloadTestObserverTerminal::DownloadTestObserverTerminal(
DownloadManager* download_manager,
size_t wait_count,
DangerousDownloadAction dangerous_download_action)
: … { … }
DownloadTestObserverTerminal::~DownloadTestObserverTerminal() { … }
bool DownloadTestObserverTerminal::IsDownloadInFinalState(
download::DownloadItem* download) { … }
DownloadTestObserverInProgress::DownloadTestObserverInProgress(
DownloadManager* download_manager,
size_t wait_count)
: … { … }
DownloadTestObserverInProgress::~DownloadTestObserverInProgress() { … }
bool DownloadTestObserverInProgress::IsDownloadInFinalState(
download::DownloadItem* download) { … }
DownloadTestObserverInterrupted::DownloadTestObserverInterrupted(
DownloadManager* download_manager,
size_t wait_count,
DangerousDownloadAction dangerous_download_action)
: … { … }
DownloadTestObserverInterrupted::~DownloadTestObserverInterrupted() { … }
bool DownloadTestObserverInterrupted::IsDownloadInFinalState(
download::DownloadItem* download) { … }
void PingIOThread(int cycle, base::OnceClosure callback);
void PingFileThread(int cycle, base::OnceClosure callback) { … }
void PingIOThread(int cycle, base::OnceClosure callback) { … }
DownloadTestFlushObserver::DownloadTestFlushObserver(
DownloadManager* download_manager)
: … { … }
void DownloadTestFlushObserver::WaitForFlush() { … }
void DownloadTestFlushObserver::OnDownloadCreated(
DownloadManager* manager,
download::DownloadItem* item) { … }
void DownloadTestFlushObserver::ManagerGoingDown(DownloadManager* manager) { … }
void DownloadTestFlushObserver::OnDownloadDestroyed(
download::DownloadItem* download) { … }
void DownloadTestFlushObserver::OnDownloadUpdated(
download::DownloadItem* download) { … }
DownloadTestFlushObserver::~DownloadTestFlushObserver() { … }
void DownloadTestFlushObserver::CheckDownloadsInProgress(
bool observe_downloads) { … }
DownloadTestItemCreationObserver::DownloadTestItemCreationObserver()
: … { … }
DownloadTestItemCreationObserver::~DownloadTestItemCreationObserver() { … }
void DownloadTestItemCreationObserver::WaitForDownloadItemCreation() { … }
void DownloadTestItemCreationObserver::DownloadItemCreationCallback(
download::DownloadItem* item,
download::DownloadInterruptReason interrupt_reason) { … }
download::DownloadUrlParameters::OnStartedCallback
DownloadTestItemCreationObserver::callback() { … }
SavePackageFinishedObserver::SavePackageFinishedObserver(
DownloadManager* manager,
base::OnceClosure callback,
std::set<download::DownloadItem::DownloadState> final_states)
: … { … }
SavePackageFinishedObserver::~SavePackageFinishedObserver() { … }
void SavePackageFinishedObserver::OnDownloadUpdated(
download::DownloadItem* download) { … }
void SavePackageFinishedObserver::OnDownloadDestroyed(
download::DownloadItem* download) { … }
void SavePackageFinishedObserver::OnDownloadCreated(
DownloadManager* manager,
download::DownloadItem* download) { … }
void SavePackageFinishedObserver::ManagerGoingDown(DownloadManager* manager) { … }
}