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

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

Issue 686373002: Revert of Remote assistance on Chrome OS Part IV - It2MeHost (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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
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/message_loop.h" 7 #include "base/message_loop/message_loop.h"
8 #include "base/run_loop.h" 8 #include "base/run_loop.h"
9 #include "base/synchronization/waitable_event.h" 9 #include "base/synchronization/waitable_event.h"
10 #include "remoting/host/dns_blackhole_checker.h" 10 #include "remoting/host/dns_blackhole_checker.h"
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 #endif 92 #endif
93 } 93 }
94 94
95 protected: 95 protected:
96 void StartWatching() { 96 void StartWatching() {
97 policy_watcher_->StartWatching(policy_callback_); 97 policy_watcher_->StartWatching(policy_callback_);
98 base::RunLoop().RunUntilIdle(); 98 base::RunLoop().RunUntilIdle();
99 } 99 }
100 100
101 void StopWatching() { 101 void StopWatching() {
102 EXPECT_CALL(*this, PostPolicyWatcherShutdown()).Times(1); 102 base::WaitableEvent stop_event(false, false);
103 policy_watcher_->StopWatching(base::Bind( 103 policy_watcher_->StopWatching(&stop_event);
104 &PolicyWatcherTest::PostPolicyWatcherShutdown, base::Unretained(this)));
105 base::RunLoop().RunUntilIdle(); 104 base::RunLoop().RunUntilIdle();
105 EXPECT_EQ(true, stop_event.IsSignaled());
106 } 106 }
107 107
108 MOCK_METHOD0(PostPolicyWatcherShutdown, void());
109
110 static const char* kHostDomain; 108 static const char* kHostDomain;
111 static const char* kPortRange; 109 static const char* kPortRange;
112 base::MessageLoop message_loop_; 110 base::MessageLoop message_loop_;
113 scoped_refptr<base::MessageLoopProxy> message_loop_proxy_; 111 scoped_refptr<base::MessageLoopProxy> message_loop_proxy_;
114 MockPolicyCallback mock_policy_callback_; 112 MockPolicyCallback mock_policy_callback_;
115 PolicyWatcher::PolicyCallback policy_callback_; 113 PolicyWatcher::PolicyCallback policy_callback_;
116 scoped_ptr<FakePolicyWatcher> policy_watcher_; 114 scoped_ptr<FakePolicyWatcher> policy_watcher_;
117 base::DictionaryValue empty_; 115 base::DictionaryValue empty_;
118 base::DictionaryValue nat_true_; 116 base::DictionaryValue nat_true_;
119 base::DictionaryValue nat_false_; 117 base::DictionaryValue nat_false_;
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
399 397
400 StartWatching(); 398 StartWatching();
401 policy_watcher_->SetPolicies(&empty_); 399 policy_watcher_->SetPolicies(&empty_);
402 policy_watcher_->SetPolicies(&port_range_full_); 400 policy_watcher_->SetPolicies(&port_range_full_);
403 policy_watcher_->SetPolicies(&port_range_empty_); 401 policy_watcher_->SetPolicies(&port_range_empty_);
404 StopWatching(); 402 StopWatching();
405 } 403 }
406 404
407 } // namespace policy_hack 405 } // namespace policy_hack
408 } // namespace remoting 406 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/policy_hack/policy_watcher_mac.mm ('k') | remoting/host/policy_hack/policy_watcher_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698