#include "chrome/browser/ui/webui/managed_ui_handler.h"
#include <optional>
#include "base/token.h"
#include "base/values.h"
#include "build/chromeos_buildflags.h"
#include "chrome/browser/policy/profile_policy_connector.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/test/base/testing_profile.h"
#include "components/policy/core/common/mock_configuration_policy_provider.h"
#include "components/policy/core/common/policy_service_impl.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_ui_data_source.h"
#include "content/public/test/browser_task_environment.h"
#include "content/public/test/test_web_ui.h"
#include "content/public/test/test_web_ui_data_source.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#if !BUILDFLAG(IS_CHROMEOS_ASH)
#include "components/policy/core/browser/browser_policy_connector_base.h"
#endif
class TestManagedUIHandler : public ManagedUIHandler { … };
class ManagedUIHandlerTest : public testing::Test { … };
TEST_F(ManagedUIHandlerTest, DISABLED_ManagedUIDisabledByDefault) { … }
TEST_F(ManagedUIHandlerTest, DISABLED_ManagedUIEnabledWhenManaged) { … }
TEST_F(ManagedUIHandlerTest, DISABLED_ManagedUIBecomesEnabledByProfile) { … }
#if BUILDFLAG(IS_CHROMEOS_ASH)
TEST_F(ManagedUIHandlerTest, ManagedUIDisabledForChildAccount) {
profile_policy_connector()->OverrideIsManagedForTesting(true);
profile()->SetIsSupervisedProfile();
InitializeHandler();
EXPECT_FALSE(IsSourceManaged());
}
#endif