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 600f409a2f2dd6e545652d4279768a09cbf2cfb2..c88cfc96b0d8c2491d68cd9dfb053b202f15cc6e 100644 |
--- a/remoting/host/policy_hack/policy_watcher_unittest.cc |
+++ b/remoting/host/policy_hack/policy_watcher_unittest.cc |
@@ -68,6 +68,8 @@ class PolicyWatcherTest : public testing::Test { |
nat_true_and_overridden_.SetString( |
PolicyWatcher::kHostDebugOverridePoliciesName, |
kOverrideNatTraversalToFalse); |
+ pairing_true_.SetBoolean(PolicyWatcher::kHostAllowClientPairing, true); |
+ pairing_false_.SetBoolean(PolicyWatcher::kHostAllowClientPairing, false); |
#if !defined(NDEBUG) |
SetDefaults(nat_false_overridden_others_default_); |
nat_false_overridden_others_default_.SetBoolean( |
@@ -115,6 +117,8 @@ class PolicyWatcherTest : public testing::Test { |
base::DictionaryValue unknown_policies_; |
base::DictionaryValue nat_true_and_overridden_; |
base::DictionaryValue nat_false_overridden_others_default_; |
+ base::DictionaryValue pairing_true_; |
+ base::DictionaryValue pairing_false_; |
private: |
void SetDefaults(base::DictionaryValue& dict) { |
@@ -128,6 +132,7 @@ class PolicyWatcherTest : public testing::Test { |
dict.SetString(PolicyWatcher::kHostTokenUrlPolicyName, std::string()); |
dict.SetString(PolicyWatcher::kHostTokenValidationUrlPolicyName, |
std::string()); |
+ dict.SetBoolean(PolicyWatcher::kHostAllowClientPairing, true); |
#if !defined(NDEBUG) |
dict.SetString(PolicyWatcher::kHostDebugOverridePoliciesName, ""); |
#endif |
@@ -308,5 +313,21 @@ TEST_F(PolicyWatcherTest, DebugOverrideNatPolicy) { |
StopWatching(); |
} |
+TEST_F(PolicyWatcherTest, PairingFalseThenTrue) { |
+ testing::InSequence sequence; |
+ EXPECT_CALL(mock_policy_callback_, |
+ OnPolicyUpdatePtr(IsPolicies(&nat_true_others_default_))); |
+ EXPECT_CALL(mock_policy_callback_, |
+ OnPolicyUpdatePtr(IsPolicies(&pairing_false_))); |
+ EXPECT_CALL(mock_policy_callback_, |
+ OnPolicyUpdatePtr(IsPolicies(&pairing_true_))); |
+ |
+ StartWatching(); |
+ policy_watcher_->SetPolicies(&empty_); |
+ policy_watcher_->SetPolicies(&pairing_false_); |
+ policy_watcher_->SetPolicies(&pairing_true_); |
+ StopWatching(); |
+} |
+ |
} // namespace policy_hack |
} // namespace remoting |