#include "components/offline_pages/core/model/add_page_task.h"
#include <stdint.h>
#include <memory>
#include <optional>
#include <string>
#include "base/files/file_path.h"
#include "base/functional/bind.h"
#include "base/memory/weak_ptr.h"
#include "base/strings/utf_string_conversions.h"
#include "components/offline_pages/core/model/model_task_test_base.h"
#include "components/offline_pages/core/model/offline_page_item_generator.h"
#include "components/offline_pages/core/offline_page_types.h"
#include "components/offline_pages/core/offline_store_types.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"
namespace offline_pages {
namespace {
const char kTestNamespace[] = …;
const int64_t kTestOfflineId1 = …;
const ClientId kTestClientId1(kTestNamespace, "1234");
const base::FilePath kTestFilePath(FILE_PATH_LITERAL("/test/path/file"));
const int64_t kTestFileSize = …;
const std::string kTestOrigin("abc.xyz");
const std::u16string kTestTitle = …;
const int64_t kTestDownloadId = …;
const std::string kTestDigest("TesTIngDigEst==");
const std::string kTestAttribution = …;
const std::string kTestSnippet = …;
}
class AddPageTaskTest : public ModelTaskTestBase { … };
void AddPageTaskTest::ResetResults() { … }
void AddPageTaskTest::OnAddPageDone(AddPageResult result) { … }
AddPageTask::AddPageTaskCallback AddPageTaskTest::add_page_callback() { … }
void AddPageTaskTest::AddPage(const OfflinePageItem& page) { … }
bool AddPageTaskTest::CheckPageStored(const OfflinePageItem& page) { … }
TEST_F(AddPageTaskTest, AddPage) { … }
TEST_F(AddPageTaskTest, AddPageWithAllFieldsSet) { … }
TEST_F(AddPageTaskTest, AddTwoPages) { … }
TEST_F(AddPageTaskTest, AddTwoIdenticalPages) { … }
TEST_F(AddPageTaskTest, AddPageWithInvalidStore) { … }
}