#include "remoting/host/policy_watcher.h"
#include "base/containers/flat_set.h"
#include "base/functional/bind.h"
#include "base/json/json_writer.h"
#include "base/memory/ptr_util.h"
#include "base/memory/raw_ptr.h"
#include "base/run_loop.h"
#include "base/synchronization/waitable_event.h"
#include "base/task/single_thread_task_runner.h"
#include "base/test/mock_log.h"
#include "base/test/task_environment.h"
#include "base/values.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "components/policy/core/common/fake_async_policy_loader.h"
#include "components/policy/policy_constants.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace remoting {
key;
_;
MATCHER_P(IsPolicies, dict, "") { … }
MATCHER_P(ContainsSubstring, substring, "") { … }
class MockPolicyCallback { … };
class PolicyWatcherTest : public testing::Test { … };
const char* PolicyWatcherTest::kHostDomain = …;
const char* PolicyWatcherTest::kClientDomain = …;
const char* PolicyWatcherTest::kPortRange = …;
TEST_F(PolicyWatcherTest, None) { … }
TEST_F(PolicyWatcherTest, NatTrue) { … }
TEST_F(PolicyWatcherTest, NatFalse) { … }
TEST_F(PolicyWatcherTest, NatWrongType) { … }
TEST_F(PolicyWatcherTest, NatWrongTypeThenIrrelevantChange) { … }
TEST_F(PolicyWatcherTest, PortRangeMalformedThenIrrelevantChange) { … }
TEST_F(PolicyWatcherTest, DomainEmpty) { … }
TEST_F(PolicyWatcherTest, DomainFull) { … }
TEST_F(PolicyWatcherTest, NatNoneThenTrue) { … }
TEST_F(PolicyWatcherTest, NatNoneThenTrueThenTrue) { … }
TEST_F(PolicyWatcherTest, NatNoneThenTrueThenTrueThenFalse) { … }
TEST_F(PolicyWatcherTest, NatNoneThenFalse) { … }
TEST_F(PolicyWatcherTest, NatNoneThenFalseThenTrue) { … }
TEST_F(PolicyWatcherTest, ChangeOneRepeatedlyThenTwo) { … }
TEST_F(PolicyWatcherTest, FilterUnknownPolicies) { … }
class MisspelledPolicyTest : public PolicyWatcherTest,
public ::testing::WithParamInterface<const char*> { … };
TEST_P(MisspelledPolicyTest, WarningLogged) { … }
INSTANTIATE_TEST_SUITE_P(…);
#if !BUILDFLAG(IS_CHROMEOS)
TEST_F(PolicyWatcherTest, PairingFalseThenTrue) { … }
TEST_F(PolicyWatcherTest, GnubbyAuth) { … }
#endif
TEST_F(PolicyWatcherTest, RemoteAssistanceUiAccess) { … }
TEST_F(PolicyWatcherTest, Relay) { … }
#if !BUILDFLAG(IS_CHROMEOS_ASH)
TEST_F(PolicyWatcherTest, Curtain) { … }
#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC)
TEST_F(PolicyWatcherTest, MatchUsername) { … }
#endif
#endif
TEST_F(PolicyWatcherTest, UdpPortRange) { … }
TEST_F(PolicyWatcherTest, PolicySchemaAndPolicyWatcherShouldBeInSync) { … }
TEST_F(PolicyWatcherTest, SchemaTypeCheck) { … }
TEST_F(PolicyWatcherTest, DeprecatedOnly) { … }
TEST_F(PolicyWatcherTest, DeprecatedAndNew) { … }
TEST_F(PolicyWatcherTest, DeprecatedEmpty) { … }
TEST_F(PolicyWatcherTest, GetEffectivePolicies) { … }
TEST_F(PolicyWatcherTest, GetEffectivePoliciesError) { … }
TEST_F(PolicyWatcherTest, GetPlatformPolicies) { … }
TEST_F(PolicyWatcherTest, GetPlatformPoliciesMultipleOverrides) { … }
TEST_F(PolicyWatcherTest, GetPlatformPoliciesError) { … }
}