#include "components/search_engines/default_search_manager.h"
#include <stddef.h>
#include <memory>
#include <utility>
#include "base/strings/string_split.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/scoped_feature_list.h"
#include "base/time/time.h"
#include "build/chromeos_buildflags.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_engine_type.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_engines_test_util.h"
#include "components/search_engines/template_url_data.h"
#include "components/search_engines/template_url_data_util.h"
#include "components/search_engines/template_url_prepopulate_data.h"
#include "components/sync_preferences/testing_pref_service_syncable.h"
#include "components/variations/scoped_variations_ids_provider.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"
namespace {
void SetOverrides(sync_preferences::TestingPrefServiceSyncable* prefs,
bool update) { … }
void SetPolicy(sync_preferences::TestingPrefServiceSyncable* prefs,
bool enabled,
TemplateURLData* data,
bool is_mandatory) { … }
}
class DefaultSearchManagerTest : public testing::Test { … };
TEST_F(DefaultSearchManagerTest, ReadAndWritePref) { … }
TEST_F(DefaultSearchManagerTest, DefaultSearchSetByUserPref) { … }
TEST_F(DefaultSearchManagerTest, DefaultSearchSetByOverrides) { … }
TEST_F(DefaultSearchManagerTest, DefaultSearchSetByEnforcedPolicy) { … }
TEST_F(DefaultSearchManagerTest, DefaultSearchSetByRecommendedPolicy) { … }
TEST_F(DefaultSearchManagerTest, DefaultSearchSetByUserAndRecommendedPolicy) { … }
TEST_F(DefaultSearchManagerTest, DefaultSearchSetByExtension) { … }
TEST_F(DefaultSearchManagerTest,
DefaultSearchSetByPlayAPI_MergeByPrepopulatedId) { … }
TEST_F(DefaultSearchManagerTest,
DefaultSearchSetByPlayAPI_MergeByKeyword_FeatureDisabled) { … }
TEST_F(DefaultSearchManagerTest,
DefaultSearchSetByPlayAPI_MergeByKeyword_FeatureEnabled) { … }
TEST_F(DefaultSearchManagerTest,
DefaultSearchSetByPlayAPI_MergeByDomainName_FeatureDisabled) { … }
TEST_F(DefaultSearchManagerTest,
DefaultSearchSetByPlayAPI_MergeByDomainName_FeatureEnabled) { … }