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

Side by Side Diff: remoting/host/policy_hack/policy_watcher_unittest.cc

Issue 10873050: [Chromoting] Hook up host talkgadget policy checks. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Change int to bool Created 8 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « remoting/host/policy_hack/policy_watcher_linux.cc ('k') | remoting/host/remoting_me2me_host.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/basictypes.h" 5 #include "base/basictypes.h"
6 #include "base/bind.h" 6 #include "base/bind.h"
7 #include "base/message_loop.h" 7 #include "base/message_loop.h"
8 #include "base/synchronization/waitable_event.h" 8 #include "base/synchronization/waitable_event.h"
9 #include "remoting/host/constants.h" 9 #include "remoting/host/dns_blackhole_checker.h"
10 #include "remoting/host/policy_hack/fake_policy_watcher.h" 10 #include "remoting/host/policy_hack/fake_policy_watcher.h"
11 #include "remoting/host/policy_hack/mock_policy_callback.h" 11 #include "remoting/host/policy_hack/mock_policy_callback.h"
12 #include "remoting/host/policy_hack/policy_watcher.h" 12 #include "remoting/host/policy_hack/policy_watcher.h"
13 #include "testing/gmock/include/gmock/gmock.h" 13 #include "testing/gmock/include/gmock/gmock.h"
14 #include "testing/gtest/include/gtest/gtest.h" 14 #include "testing/gtest/include/gtest/gtest.h"
15 15
16 namespace remoting { 16 namespace remoting {
17 namespace policy_hack { 17 namespace policy_hack {
18 18
19 class PolicyWatcherTest : public testing::Test { 19 class PolicyWatcherTest : public testing::Test {
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 base::DictionaryValue nat_false_domain_empty_; 92 base::DictionaryValue nat_false_domain_empty_;
93 base::DictionaryValue nat_false_domain_full_; 93 base::DictionaryValue nat_false_domain_full_;
94 base::DictionaryValue nat_true_domain_empty_others_default_; 94 base::DictionaryValue nat_true_domain_empty_others_default_;
95 95
96 private: 96 private:
97 void SetDefaults(base::DictionaryValue& dict) { 97 void SetDefaults(base::DictionaryValue& dict) {
98 dict.SetBoolean(PolicyWatcher::kNatPolicyName, true); 98 dict.SetBoolean(PolicyWatcher::kNatPolicyName, true);
99 dict.SetBoolean(PolicyWatcher::kHostRequireTwoFactorPolicyName, false); 99 dict.SetBoolean(PolicyWatcher::kHostRequireTwoFactorPolicyName, false);
100 dict.SetString(PolicyWatcher::kHostDomainPolicyName, ""); 100 dict.SetString(PolicyWatcher::kHostDomainPolicyName, "");
101 dict.SetString(PolicyWatcher::kHostTalkGadgetPrefixPolicyName, 101 dict.SetString(PolicyWatcher::kHostTalkGadgetPrefixPolicyName,
102 kDefaultTalkGadgetPrefix); 102 kDefaultHostTalkGadgetPrefix);
103 dict.SetBoolean(PolicyWatcher::kHostRequireCurtainPolicyName, false); 103 dict.SetBoolean(PolicyWatcher::kHostRequireCurtainPolicyName, false);
104 } 104 }
105 }; 105 };
106 106
107 const char* PolicyWatcherTest::kHostDomain = "google.com"; 107 const char* PolicyWatcherTest::kHostDomain = "google.com";
108 108
109 MATCHER_P(IsPolicies, dict, "") { 109 MATCHER_P(IsPolicies, dict, "") {
110 return arg->Equals(dict); 110 return arg->Equals(dict);
111 } 111 }
112 112
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 policy_watcher_->SetPolicies(&nat_true_domain_empty_); 247 policy_watcher_->SetPolicies(&nat_true_domain_empty_);
248 policy_watcher_->SetPolicies(&nat_true_domain_full_); 248 policy_watcher_->SetPolicies(&nat_true_domain_full_);
249 policy_watcher_->SetPolicies(&nat_false_domain_full_); 249 policy_watcher_->SetPolicies(&nat_false_domain_full_);
250 policy_watcher_->SetPolicies(&nat_false_domain_empty_); 250 policy_watcher_->SetPolicies(&nat_false_domain_empty_);
251 policy_watcher_->SetPolicies(&nat_true_domain_full_); 251 policy_watcher_->SetPolicies(&nat_true_domain_full_);
252 StopWatching(); 252 StopWatching();
253 } 253 }
254 254
255 } // namespace policy_hack 255 } // namespace policy_hack
256 } // namespace remoting 256 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/policy_hack/policy_watcher_linux.cc ('k') | remoting/host/remoting_me2me_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698