OLD | NEW |
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/dns_blackhole_checker.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" |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 } | 85 } |
86 | 86 |
87 void StopWatching() { | 87 void StopWatching() { |
88 base::WaitableEvent stop_event(false, false); | 88 base::WaitableEvent stop_event(false, false); |
89 policy_watcher_->StopWatching(&stop_event); | 89 policy_watcher_->StopWatching(&stop_event); |
90 message_loop_.RunUntilIdle(); | 90 message_loop_.RunUntilIdle(); |
91 EXPECT_EQ(true, stop_event.IsSignaled()); | 91 EXPECT_EQ(true, stop_event.IsSignaled()); |
92 } | 92 } |
93 | 93 |
94 static const char* kHostDomain; | 94 static const char* kHostDomain; |
95 MessageLoop message_loop_; | 95 base::MessageLoop message_loop_; |
96 scoped_refptr<base::MessageLoopProxy> message_loop_proxy_; | 96 scoped_refptr<base::MessageLoopProxy> message_loop_proxy_; |
97 MockPolicyCallback mock_policy_callback_; | 97 MockPolicyCallback mock_policy_callback_; |
98 PolicyWatcher::PolicyCallback policy_callback_; | 98 PolicyWatcher::PolicyCallback policy_callback_; |
99 scoped_ptr<FakePolicyWatcher> policy_watcher_; | 99 scoped_ptr<FakePolicyWatcher> policy_watcher_; |
100 base::DictionaryValue empty_; | 100 base::DictionaryValue empty_; |
101 base::DictionaryValue nat_true_; | 101 base::DictionaryValue nat_true_; |
102 base::DictionaryValue nat_false_; | 102 base::DictionaryValue nat_false_; |
103 base::DictionaryValue nat_one_; | 103 base::DictionaryValue nat_one_; |
104 base::DictionaryValue domain_empty_; | 104 base::DictionaryValue domain_empty_; |
105 base::DictionaryValue domain_full_; | 105 base::DictionaryValue domain_full_; |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 OnPolicyUpdatePtr(IsPolicies(&nat_true_others_default_))); | 303 OnPolicyUpdatePtr(IsPolicies(&nat_true_others_default_))); |
304 #endif | 304 #endif |
305 | 305 |
306 StartWatching(); | 306 StartWatching(); |
307 policy_watcher_->SetPolicies(&nat_true_and_overridden_); | 307 policy_watcher_->SetPolicies(&nat_true_and_overridden_); |
308 StopWatching(); | 308 StopWatching(); |
309 } | 309 } |
310 | 310 |
311 } // namespace policy_hack | 311 } // namespace policy_hack |
312 } // namespace remoting | 312 } // namespace remoting |
OLD | NEW |