#include <sstream>
#include "base/containers/to_vector.h"
#include "base/location.h"
#include "base/memory/raw_ptr.h"
#include "base/ranges/algorithm.h"
#include "base/test/scoped_feature_list.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/media/router/media_router_feature.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/profiles/profile_selections.h"
#include "chrome/browser/ui/ui_features.h"
#include "chrome/common/chrome_features.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "chrome/test/base/profile_waiter.h"
#include "components/enterprise/buildflags/buildflags.h"
#include "components/keyed_service/content/browser_context_dependency_manager.h"
#include "components/keyed_service/core/dependency_graph.h"
#include "components/keyed_service/core/keyed_service_base_factory.h"
#include "components/omnibox/common/omnibox_features.h"
#include "components/optimization_guide/machine_learning_tflite_buildflags.h"
#include "components/signin/public/base/signin_switches.h"
#include "content/public/common/content_features.h"
#include "content/public/test/browser_test.h"
#include "content/public/test/test_utils.h"
#include "extensions/buildflags/buildflags.h"
#include "net/base/features.h"
#include "pdf/buildflags.h"
#include "printing/buildflags/buildflags.h"
#include "testing/gmock/include/gmock/gmock-matchers.h"
#include "third_party/blink/public/common/features.h"
#include "ui/accessibility/accessibility_features.h"
#include "ui/base/ui_base_features.h"
#if !BUILDFLAG(IS_ANDROID)
#include "chrome/common/companion/visual_query/features.h"
#endif
namespace {
Profile* CreateProfileAndWaitForAllTasks(const base::FilePath& profile_path) { … }
std::vector<KeyedServiceBaseFactory*> GetKeyedServiceBaseFactories() { … }
std::string GetDifferenceString(const std::set<std::string>& set1,
const std::set<std::string>& set2) { … }
std::string DisplaySetDifference(
const std::set<std::string>& expected_active_services_names,
const std::set<std::string>& active_services_names) { … }
void TestKeyedProfileServicesActives(
Profile* profile,
const std::set<std::string>& expected_active_services_names,
bool force_create_services = false,
const base::Location& location = FROM_HERE) { … }
}
TEST(ProfileKeyedService_DisplaySetDifferenceTest, UnexpectedActiveService) { … }
TEST(ProfileKeyedService_DisplaySetDifferenceTest, MissingExpectedService) { … }
class ProfileKeyedServiceBrowserTest : public InProcessBrowserTest { … };
IN_PROC_BROWSER_TEST_F(ProfileKeyedServiceBrowserTest,
SystemProfileOTR_NeededServices) { … }
IN_PROC_BROWSER_TEST_F(ProfileKeyedServiceBrowserTest,
SystemProfileParent_NeededServices) { … }
IN_PROC_BROWSER_TEST_F(ProfileKeyedServiceBrowserTest,
GuestProfileOTR_NeededServices) { … }
IN_PROC_BROWSER_TEST_F(ProfileKeyedServiceBrowserTest,
GuestProfileParent_NeededServices) { … }
IN_PROC_BROWSER_TEST_F(ProfileKeyedServiceBrowserTest,
SystemProfileParent_ServicesThatCanBeCreated) { … }
IN_PROC_BROWSER_TEST_F(ProfileKeyedServiceBrowserTest,
SystemProfileOTR_ServicesThatCanBeCreated) { … }