#include "chrome/browser/download/download_query.h"
#include <stddef.h>
#include <stdint.h>
#include <limits>
#include <memory>
#include <string>
#include <utility>
#include "base/check.h"
#include "base/files/file_path.h"
#include "base/functional/bind.h"
#include "base/memory/raw_ptr.h"
#include "base/time/time.h"
#include "base/values.h"
#include "build/build_config.h"
#include "components/download/public/common/mock_download_item.h"
#include "content/public/browser/download_item_utils.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
Time;
DownloadItem;
_;
Return;
ReturnRef;
DownloadVector;
namespace {
constexpr int kSomeKnownTime = …;
constexpr char kSomeKnownTime8601[] = …;
constexpr char k8601Suffix[] = …;
constexpr int64_t kEightGB = …;
constexpr int64_t kSixteenGB = …;
constexpr double kEightGBDouble = …;
constexpr double kNineGBDouble = …;
bool IdNotEqual(uint32_t not_id, const DownloadItem& item) { … }
bool AlwaysReturn(bool result, const DownloadItem& item) { … }
}
class DownloadQueryTest : public testing::Test { … };
template<> void DownloadQueryTest::AddFilter(
DownloadQuery::FilterType name, bool cpp_value) { … }
template <>
void DownloadQueryTest::AddFilter(DownloadQuery::FilterType name,
double cpp_value) { … }
template<> void DownloadQueryTest::AddFilter(
DownloadQuery::FilterType name, const char* cpp_value) { … }
template<> void DownloadQueryTest::AddFilter(
DownloadQuery::FilterType name, std::string cpp_value) { … }
template <>
void DownloadQueryTest::AddFilter(DownloadQuery::FilterType name,
const char16_t* cpp_value) { … }
template <>
void DownloadQueryTest::AddFilter(DownloadQuery::FilterType name,
std::vector<std::u16string> cpp_value) { … }
template<> void DownloadQueryTest::AddFilter(
DownloadQuery::FilterType name, std::vector<std::string> cpp_value) { … }
TEST_F(DownloadQueryTest, DownloadQueryTest_ZeroItems) { … }
TEST_F(DownloadQueryTest, DownloadQueryTest_InvalidFilter) { … }
TEST_F(DownloadQueryTest, DownloadQueryTest_EmptyQuery) { … }
TEST_F(DownloadQueryTest, DownloadQueryTest_Limit) { … }
TEST_F(DownloadQueryTest, DownloadQueryTest_FilterGenericQueryFilename) { … }
TEST_F(DownloadQueryTest, DownloadQueryTest_FilterGenericQueryOriginalUrl) { … }
TEST_F(DownloadQueryTest,
DownloadQueryTest_FilterGenericQueryOriginalUrlUnescaping) { … }
TEST_F(DownloadQueryTest, DownloadQueryTest_FilterGenericQueryUrl) { … }
TEST_F(DownloadQueryTest, DownloadQueryTest_FilterGenericQueryUrlUnescaping) { … }
TEST_F(DownloadQueryTest, DownloadQueryTest_FilterGenericQueryFilenameI18N) { … }
TEST_F(DownloadQueryTest, DownloadQueryTest_FilterFilenameRegex) { … }
TEST_F(DownloadQueryTest, DownloadQueryTest_SortFilename) { … }
TEST_F(DownloadQueryTest, DownloadQueryTest_FilterFilename) { … }
TEST_F(DownloadQueryTest, DownloadQueryTest_FilterOriginalUrlRegex) { … }
TEST_F(DownloadQueryTest, DownloadQueryTest_SortOriginalUrl) { … }
TEST_F(DownloadQueryTest, DownloadQueryTest_FilterOriginalUrl) { … }
TEST_F(DownloadQueryTest, DownloadQueryTest_FilterUrlRegex) { … }
TEST_F(DownloadQueryTest, DownloadQueryTest_SortUrl) { … }
TEST_F(DownloadQueryTest, DownloadQueryTest_FilterUrl) { … }
TEST_F(DownloadQueryTest, DownloadQueryTest_FilterCallback) { … }
TEST_F(DownloadQueryTest, DownloadQueryTest_FilterBytesReceived) { … }
TEST_F(DownloadQueryTest, DownloadQueryTest_SortBytesReceived) { … }
TEST_F(DownloadQueryTest, DownloadQueryTest_FilterDangerAccepted) { … }
TEST_F(DownloadQueryTest, DownloadQueryTest_SortDangerAccepted) { … }
TEST_F(DownloadQueryTest, DownloadQueryTest_FilterExists) { … }
TEST_F(DownloadQueryTest, DownloadQueryTest_SortExists) { … }
TEST_F(DownloadQueryTest, DownloadQueryTest_FilterMime) { … }
TEST_F(DownloadQueryTest, DownloadQueryTest_SortMime) { … }
TEST_F(DownloadQueryTest, DownloadQueryTest_FilterPaused) { … }
TEST_F(DownloadQueryTest, DownloadQueryTest_SortPaused) { … }
TEST_F(DownloadQueryTest, DownloadQueryTest_FilterStartedAfter) { … }
TEST_F(DownloadQueryTest, DownloadQueryTest_FilterStartedBefore) { … }
TEST_F(DownloadQueryTest, DownloadQueryTest_FilterStartTime) { … }
TEST_F(DownloadQueryTest, DownloadQueryTest_SortStartTime) { … }
TEST_F(DownloadQueryTest, DownloadQueryTest_FilterEndedAfter) { … }
TEST_F(DownloadQueryTest, DownloadQueryTest_FilterEndedBefore) { … }
TEST_F(DownloadQueryTest, DownloadQueryTest_FilterEndTime) { … }
TEST_F(DownloadQueryTest, DownloadQueryTest_SortEndTime) { … }
TEST_F(DownloadQueryTest, DownloadQueryTest_FilterTotalBytesGreater1) { … }
TEST_F(DownloadQueryTest, DownloadQueryTest_FilterTotalBytesGreater2) { … }
TEST_F(DownloadQueryTest, DownloadQueryTest_FilterTotalBytesGreater3) { … }
TEST_F(DownloadQueryTest, DownloadQueryTest_FilterTotalBytesGreater4) { … }
TEST_F(DownloadQueryTest, DownloadQueryTest_FilterTotalBytesLess1) { … }
TEST_F(DownloadQueryTest, DownloadQueryTest_FilterTotalBytesLess2) { … }
TEST_F(DownloadQueryTest, DownloadQueryTest_FilterTotalBytesLess3) { … }
TEST_F(DownloadQueryTest, DownloadQueryTest_FilterTotalBytesLess4) { … }
TEST_F(DownloadQueryTest, DownloadQueryTest_FilterTotalBytes1) { … }
TEST_F(DownloadQueryTest, DownloadQueryTest_FilterTotalBytes2) { … }
TEST_F(DownloadQueryTest, DownloadQueryTest_FilterTotalBytes3) { … }
TEST_F(DownloadQueryTest, DownloadQueryTest_SortTotalBytes) { … }
TEST_F(DownloadQueryTest, DownloadQueryTest_FilterState) { … }
TEST_F(DownloadQueryTest, DownloadQueryTest_SortState) { … }
TEST_F(DownloadQueryTest, DownloadQueryTest_FilterDanger) { … }
TEST_F(DownloadQueryTest, DownloadQueryTest_SortDanger) { … }
TEST_F(DownloadQueryTest, DownloadQueryTest_DefaultSortById1) { … }
TEST_F(DownloadQueryTest, DownloadQueryTest_DefaultSortById2) { … }
TEST_F(DownloadQueryTest, DownloadQueryFilterPerformance) { … }