#include <stddef.h>
#include <memory>
#include "base/files/scoped_temp_dir.h"
#include "base/memory/scoped_refptr.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/scoped_feature_list.h"
#include "base/test/task_environment.h"
#include "base/values.h"
#include "components/country_codes/country_codes.h"
#include "components/search_engines/keyword_web_data_service.h"
#include "components/search_engines/prepopulated_engines.h"
#include "components/search_engines/search_engine_choice/search_engine_choice_service.h"
#include "components/search_engines/search_engines_pref_names.h"
#include "components/search_engines/search_engines_switches.h"
#include "components/search_engines/search_engines_test_environment.h"
#include "components/search_engines/search_terms_data.h"
#include "components/search_engines/template_url.h"
#include "components/search_engines/template_url_prepopulate_data.h"
#include "components/search_engines/template_url_service.h"
#include "components/search_engines/template_url_starter_pack_data.h"
#include "components/search_engines/util.h"
#include "components/webdata/common/web_database_service.h"
#include "components/webdata/common/webdata_constants.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace {
std::unique_ptr<TemplateURLData> CreatePrepopulateTemplateURLData(
int prepopulate_id,
const std::string& keyword) { … }
std::unique_ptr<TemplateURL> CreatePrepopulateTemplateURL(
int prepopulate_id,
const std::string& keyword,
TemplateURLID id,
bool is_play_api_turl = false) { … }
void CallGetSearchProvidersUsingLoadedEngines(
PrefService* prefs,
search_engines::SearchEngineChoiceService* search_engine_choice_service,
TemplateURLService::OwnedTemplateURLVector* template_urls,
WDKeywordsResult::Metadata& inout_resource_metadata) { … }
}
TEST(TemplateURLServiceUtilTest, RemoveDuplicatePrepopulateIDs) { … }
TEST(TemplateURLServiceUtilTest, MergeEnginesFromPrepopulateData_PlayAPI) { … }
TEST(TemplateURLServiceUtilTest, MergeIntoEngineData) { … }
class TemplateURLServiceUtilLoadTest : public testing::Test { … };
TEST_F(TemplateURLServiceUtilLoadTest,
GetSearchProvidersUsingLoadedEngines_choiceTriggerFeatureOff) { … }
TEST_F(TemplateURLServiceUtilLoadTest,
GetSearchProvidersUsingLoadedEngines_choiceTriggerFeatureOnOutOfEea) { … }
TEST_F(TemplateURLServiceUtilLoadTest,
GetSearchProvidersUsingLoadedEngines_choiceTriggerFeatureOnInEea) { … }