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

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: Another Windows warning Created 6 years, 10 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 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
« 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