Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(257)

Unified Diff: remoting/host/policy_hack/policy_watcher_unittest.cc

Issue 20864002: Added PIN-less auth policy. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/host/policy_hack/policy_watcher.cc ('k') | remoting/host/remoting_me2me_host.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « remoting/host/policy_hack/policy_watcher.cc ('k') | remoting/host/remoting_me2me_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698