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

Unified Diff: remoting/host/policy_watcher_unittest.cc

Issue 2847853003: Remove policy watching from It2MeHost. (Closed)
Patch Set: Remove pending policies from It2MeNativeMessagingHost and add an accessor to PolicyWatcher. Created 3 years, 8 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_watcher_unittest.cc
diff --git a/remoting/host/policy_watcher_unittest.cc b/remoting/host/policy_watcher_unittest.cc
index ccbdf6d8f46dc993d2bcc1188270a4120a3ebea2..a8e41bba2fba696a74dfe9e25ae1fc2b4ed0554f 100644
--- a/remoting/host/policy_watcher_unittest.cc
+++ b/remoting/host/policy_watcher_unittest.cc
@@ -245,7 +245,6 @@ class PolicyWatcherTest : public testing::Test {
base::DictionaryValue remote_assistance_uiaccess_true_;
base::DictionaryValue remote_assistance_uiaccess_false_;
- private:
void SetDefaults(base::DictionaryValue& dict) {
dict.SetBoolean(key::kRemoteAccessHostFirewallTraversal, true);
dict.SetBoolean(key::kRemoteAccessHostAllowRelayedConnection, true);
@@ -684,4 +683,23 @@ TEST_F(PolicyWatcherTest, SchemaTypeCheck) {
EXPECT_EQ(boolean_schema.type(), base::Value::Type::BOOLEAN);
}
+TEST_F(PolicyWatcherTest, GetCurrentPolicies) {
+ base::DictionaryValue dummy_domain, dummy_domain_plus_defaults;
+ dummy_domain.SetString(key::kRemoteAccessHostDomain, "dummy");
+ SetDefaults(dummy_domain_plus_defaults);
+ dummy_domain_plus_defaults.SetString(key::kRemoteAccessHostDomain, "dummy");
+
+ testing::InSequence sequence;
+ EXPECT_CALL(mock_policy_callback_,
+ OnPolicyUpdatePtr(IsPolicies(&nat_true_others_default_)));
+ EXPECT_CALL(mock_policy_callback_,
+ OnPolicyUpdatePtr(IsPolicies(&dummy_domain)));
+
+ StartWatching();
+ SetPolicies(dummy_domain);
+ std::unique_ptr<base::DictionaryValue> current_policies =
+ policy_watcher_->GetCurrentPolicies();
+ ASSERT_TRUE(*current_policies == dummy_domain_plus_defaults);
+}
+
} // namespace remoting
« remoting/host/it2me/it2me_host_unittest.cc ('K') | « remoting/host/policy_watcher.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698