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

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

Issue 138753005: Add gnubby authentication to remoting host (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 11 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
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 c88cfc96b0d8c2491d68cd9dfb053b202f15cc6e..16b3e2ccf4fde1e92ff5806f61eb2a8ac22e5cc9 100644
--- a/remoting/host/policy_hack/policy_watcher_unittest.cc
+++ b/remoting/host/policy_hack/policy_watcher_unittest.cc
@@ -70,6 +70,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(
@@ -119,6 +123,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) {
@@ -133,6 +139,7 @@ class PolicyWatcherTest : public testing::Test {
dict.SetString(PolicyWatcher::kHostTokenValidationUrlPolicyName,
std::string());
dict.SetBoolean(PolicyWatcher::kHostAllowClientPairing, true);
+ dict.SetBoolean(PolicyWatcher::kHostAllowGnubbyAuthPolicyName, false);
#if !defined(NDEBUG)
dict.SetString(PolicyWatcher::kHostDebugOverridePoliciesName, "");
#endif
@@ -329,5 +336,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_true_)));
+ EXPECT_CALL(mock_policy_callback_,
+ OnPolicyUpdatePtr(IsPolicies(&gnubby_auth_false_)));
+
+ StartWatching();
+ policy_watcher_->SetPolicies(&empty_);
+ policy_watcher_->SetPolicies(&gnubby_auth_true_);
+ policy_watcher_->SetPolicies(&gnubby_auth_false_);
+ StopWatching();
+}
+
} // namespace policy_hack
} // namespace remoting

Powered by Google App Engine
This is Rietveld 408576698