#include "chrome/browser/download/download_history.h"
#include <stddef.h>
#include <stdint.h>
#include <map>
#include <memory>
#include <optional>
#include <string>
#include <utility>
#include <vector>
#include "base/functional/bind.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/weak_ptr.h"
#include "base/rand_util.h"
#include "base/stl_util.h"
#include "base/test/scoped_feature_list.h"
#include "base/uuid.h"
#include "chrome/test/base/testing_profile.h"
#include "components/download/public/common/download_features.h"
#include "components/download/public/common/download_utils.h"
#include "components/download/public/common/mock_download_item.h"
#include "components/history/content/browser/download_conversions.h"
#include "components/history/core/browser/download_constants.h"
#include "components/history/core/browser/download_row.h"
#include "components/history/core/browser/history_service.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/test/browser_task_environment.h"
#include "content/public/test/mock_download_manager.h"
#include "content/public/test/test_utils.h"
#include "extensions/buildflags/buildflags.h"
#include "testing/gtest/include/gtest/gtest.h"
#if BUILDFLAG(ENABLE_EXTENSIONS)
#include "chrome/browser/extensions/api/downloads/downloads_api.h"
#endif
#if !BUILDFLAG(IS_ANDROID)
#include "chrome/browser/download/download_item_web_app_data.h"
#endif
_;
DoAll;
Invoke;
NiceMock;
Return;
ReturnRefOfCopy;
SetArgPointee;
WithArg;
namespace {
IdSet;
StrictMockDownloadItem;
enum class LoadDownloadRowResult { … };
struct CreateDownloadHistoryEntry { … };
class FakeHistoryAdapter : public DownloadHistory::HistoryAdapter { … };
class TestDownloadHistoryObserver : public DownloadHistory::Observer { … };
class DownloadHistoryTest : public testing::Test { … };
TEST_F(DownloadHistoryTest, DownloadHistoryTest_LoadWithDownloadDB) { … }
TEST_F(DownloadHistoryTest, DownloadHistoryTest_OnHistoryQueryComplete_Pre) { … }
TEST_F(DownloadHistoryTest, DownloadHistoryTest_OnHistoryQueryComplete_Post) { … }
TEST_F(DownloadHistoryTest, DownloadHistoryTest_Create) { … }
TEST_F(DownloadHistoryTest, DownloadHistoryTest_Temporary) { … }
TEST_F(DownloadHistoryTest, DownloadHistoryTest_RemoveWhileAdding) { … }
TEST_F(DownloadHistoryTest, DownloadHistoryTest_Multiple) { … }
TEST_F(DownloadHistoryTest, DownloadHistoryTest_CreateFailed) { … }
TEST_F(DownloadHistoryTest, DownloadHistoryTest_UpdateWhileAdding) { … }
TEST_F(DownloadHistoryTest, CreateCompletedItem) { … }
TEST_F(DownloadHistoryTest, CreateHistoryItemInDownloadDB) { … }
TEST_F(DownloadHistoryTest, CreateInProgressDownload) { … }
TEST_F(DownloadHistoryTest, InProgressHistoryItemBecomesNonResumable) { … }
TEST_F(DownloadHistoryTest, RemoveClearedItemFromHistory) { … }
TEST_F(DownloadHistoryTest, CreateLargeDataURLCompletedItem) { … }
TEST_F(DownloadHistoryTest,
DownloadHistoryTest_OverwrittenDownloadRemovedAfterExpiration) { … }
TEST_F(DownloadHistoryTest,
DownloadHistoryTest_OverwrittenDownloadNotRemovedPriorToExpiration) { … }
#if !BUILDFLAG(IS_ANDROID)
TEST_F(DownloadHistoryTest, ByWebAppId) { … }
#endif
}