#include "chrome/browser/predictors/resource_prefetch_predictor_tables.h"
#include <memory>
#include <set>
#include <utility>
#include <vector>
#include "base/functional/bind.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/utf_string_conversions.h"
#include "base/task/sequenced_task_runner.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/scoped_feature_list.h"
#include "chrome/browser/predictors/loading_test_util.h"
#include "chrome/browser/predictors/predictor_database.h"
#include "chrome/browser/predictors/predictors_features.h"
#include "chrome/test/base/testing_profile.h"
#include "components/sqlite_proto/key_value_table.h"
#include "content/public/test/browser_task_environment.h"
#include "content/public/test/test_utils.h"
#include "net/base/request_priority.h"
#include "sql/statement.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace predictors {
KeyValueTable;
class ResourcePrefetchPredictorTablesTest : public testing::Test { … };
class ResourcePrefetchPredictorTablesReopenTest
: public ResourcePrefetchPredictorTablesTest { … };
ResourcePrefetchPredictorTablesTest::ResourcePrefetchPredictorTablesTest()
: … { … }
ResourcePrefetchPredictorTablesTest::~ResourcePrefetchPredictorTablesTest() { … }
void ResourcePrefetchPredictorTablesTest::SetUp() { … }
void ResourcePrefetchPredictorTablesTest::TearDown() { … }
void ResourcePrefetchPredictorTablesTest::TestGetAllData() { … }
void ResourcePrefetchPredictorTablesTest::TestDeleteData() { … }
void ResourcePrefetchPredictorTablesTest::TestUpdateData() { … }
void ResourcePrefetchPredictorTablesTest::TestDeleteAllData() { … }
void ResourcePrefetchPredictorTablesTest::TestRedirectDataAreEqual(
const RedirectDataMap& lhs,
const RedirectDataMap& rhs) const { … }
void ResourcePrefetchPredictorTablesTest::TestRedirectsAreEqual(
const std::vector<RedirectStat>& lhs,
const std::vector<RedirectStat>& rhs) const { … }
void ResourcePrefetchPredictorTablesTest::TestOriginDataAreEqual(
const OriginDataMap& lhs,
const OriginDataMap& rhs) const { … }
void ResourcePrefetchPredictorTablesTest::TestOriginStatsAreEqual(
const std::vector<OriginStat>& lhs,
const std::vector<OriginStat>& rhs) const { … }
void ResourcePrefetchPredictorTablesTest::AddKey(RedirectDataMap* m,
const GURL& url) const { … }
void ResourcePrefetchPredictorTablesTest::AddKey(OriginDataMap* m,
const std::string& key) const { … }
std::string ResourcePrefetchPredictorTablesTest::GetKeyForRedirectStat(
const RedirectStat& stat) const { … }
void ResourcePrefetchPredictorTablesTest::DeleteAllData() { … }
void ResourcePrefetchPredictorTablesTest::GetAllData(
RedirectDataMap* host_redirect_data,
OriginDataMap* origin_data) const { … }
void ResourcePrefetchPredictorTablesTest::InitializeSampleData() { … }
void ResourcePrefetchPredictorTablesTest::ReopenDatabase() { … }
TEST_F(ResourcePrefetchPredictorTablesTest, ComputeOriginScore) { … }
TEST_F(ResourcePrefetchPredictorTablesTest,
ComputeOriginScore_LoadingPredictorDisregardAlwaysAccessesNetwork) { … }
TEST_F(ResourcePrefetchPredictorTablesTest, GetAllData) { … }
TEST_F(ResourcePrefetchPredictorTablesTest, UpdateData) { … }
TEST_F(ResourcePrefetchPredictorTablesTest, DeleteData) { … }
TEST_F(ResourcePrefetchPredictorTablesTest, DeleteAllData) { … }
TEST_F(ResourcePrefetchPredictorTablesTest, DatabaseVersionIsSet) { … }
TEST_F(ResourcePrefetchPredictorTablesTest, DatabaseIsResetWhenIncompatible) { … }
TEST_F(ResourcePrefetchPredictorTablesTest, ReportUMA) { … }
TEST_F(ResourcePrefetchPredictorTablesReopenTest, GetAllData) { … }
TEST_F(ResourcePrefetchPredictorTablesReopenTest, UpdateData) { … }
TEST_F(ResourcePrefetchPredictorTablesReopenTest, DeleteData) { … }
TEST_F(ResourcePrefetchPredictorTablesReopenTest, DeleteAllData) { … }
}