Index: remoting/host/policy_hack/policy_watcher_unittest.cc |
diff --git a/remoting/host/policy_hack/policy_watcher_unittest.cc b/remoting/host/policy_hack/policy_watcher_unittest.cc |
index 26aa8db28217b3b2182453c7dcaa09b4be21ee01..729a7bbad06620a00147a7070a9cf56b0a320c2d 100644 |
--- a/remoting/host/policy_hack/policy_watcher_unittest.cc |
+++ b/remoting/host/policy_hack/policy_watcher_unittest.cc |
@@ -71,6 +71,10 @@ class PolicyWatcherTest : public testing::Test { |
kOverrideNatTraversalToFalse); |
pairing_true_.SetBoolean(PolicyWatcher::kHostAllowClientPairing, true); |
pairing_false_.SetBoolean(PolicyWatcher::kHostAllowClientPairing, false); |
+ gnubby_auth_true_.SetBoolean(PolicyWatcher::kHostAllowGnubbyAuthPolicyName, |
+ true); |
+ gnubby_auth_false_.SetBoolean(PolicyWatcher::kHostAllowGnubbyAuthPolicyName, |
+ false); |
#if !defined(NDEBUG) |
SetDefaults(nat_false_overridden_others_default_); |
nat_false_overridden_others_default_.SetBoolean( |
@@ -120,6 +124,8 @@ class PolicyWatcherTest : public testing::Test { |
base::DictionaryValue nat_false_overridden_others_default_; |
base::DictionaryValue pairing_true_; |
base::DictionaryValue pairing_false_; |
+ base::DictionaryValue gnubby_auth_true_; |
+ base::DictionaryValue gnubby_auth_false_; |
private: |
void SetDefaults(base::DictionaryValue& dict) { |
@@ -136,6 +142,7 @@ class PolicyWatcherTest : public testing::Test { |
dict.SetString(PolicyWatcher::kHostTokenValidationCertIssuerPolicyName, |
std::string()); |
dict.SetBoolean(PolicyWatcher::kHostAllowClientPairing, true); |
+ dict.SetBoolean(PolicyWatcher::kHostAllowGnubbyAuthPolicyName, true); |
#if !defined(NDEBUG) |
dict.SetString(PolicyWatcher::kHostDebugOverridePoliciesName, ""); |
#endif |
@@ -332,5 +339,21 @@ TEST_F(PolicyWatcherTest, PairingFalseThenTrue) { |
StopWatching(); |
} |
+TEST_F(PolicyWatcherTest, GnubbyAuth) { |
+ testing::InSequence sequence; |
+ EXPECT_CALL(mock_policy_callback_, |
+ OnPolicyUpdatePtr(IsPolicies(&nat_true_others_default_))); |
+ EXPECT_CALL(mock_policy_callback_, |
+ OnPolicyUpdatePtr(IsPolicies(&gnubby_auth_false_))); |
+ EXPECT_CALL(mock_policy_callback_, |
+ OnPolicyUpdatePtr(IsPolicies(&gnubby_auth_true_))); |
+ |
+ StartWatching(); |
+ policy_watcher_->SetPolicies(&empty_); |
+ policy_watcher_->SetPolicies(&gnubby_auth_false_); |
+ policy_watcher_->SetPolicies(&gnubby_auth_true_); |
+ StopWatching(); |
+} |
+ |
} // namespace policy_hack |
} // namespace remoting |