OLD | NEW |
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 Loading... |
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 |
OLD | NEW |