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

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

Issue 2867223003: Send a message to the client if bad It2Me policies are read. (Closed)
Patch Set: Fix race. Created 3 years, 7 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
« no previous file with comments | « remoting/host/policy_watcher.cc ('k') | remoting/resources/remoting_strings.grd » ('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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "remoting/host/policy_watcher.h" 5 #include "remoting/host/policy_watcher.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/json/json_writer.h" 8 #include "base/json/json_writer.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 766 matching lines...) Expand 10 before | Expand all | Expand 10 after
777 EXPECT_CALL(mock_policy_callback_, 777 EXPECT_CALL(mock_policy_callback_,
778 OnPolicyUpdatePtr(IsPolicies(&nat_false_))); 778 OnPolicyUpdatePtr(IsPolicies(&nat_false_)));
779 779
780 StartWatching(); 780 StartWatching();
781 SetPolicies(nat_false_); 781 SetPolicies(nat_false_);
782 std::unique_ptr<base::DictionaryValue> current_policies = 782 std::unique_ptr<base::DictionaryValue> current_policies =
783 policy_watcher_->GetCurrentPolicies(); 783 policy_watcher_->GetCurrentPolicies();
784 ASSERT_TRUE(*current_policies == nat_false_others_default_); 784 ASSERT_TRUE(*current_policies == nat_false_others_default_);
785 } 785 }
786 786
787 TEST_F(PolicyWatcherTest, GetCurrentPoliciesError) {
788 EXPECT_CALL(mock_policy_callback_, OnPolicyError());
789
790 SetPolicies(nat_one_);
791 StartWatching();
792 std::unique_ptr<base::DictionaryValue> current_policies =
793 policy_watcher_->GetCurrentPolicies();
794 ASSERT_EQ(0u, current_policies->size());
795 }
796
787 } // namespace remoting 797 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/policy_watcher.cc ('k') | remoting/resources/remoting_strings.grd » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698