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 <cstring> | 5 #include <cstring> |
6 #include <string> | 6 #include <string> |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 return task_runner_->GetPendingTasks().front().delay; | 102 return task_runner_->GetPendingTasks().front().delay; |
103 } | 103 } |
104 | 104 |
105 const base::TimeDelta update_delay_; | 105 const base::TimeDelta update_delay_; |
106 | 106 |
107 int test_policy_id1_; | 107 int test_policy_id1_; |
108 int test_policy_id2_; | 108 int test_policy_id2_; |
109 | 109 |
110 base::TimeDelta last_delay_; | 110 base::TimeDelta last_delay_; |
111 | 111 |
112 TestingPrefService prefs_; | 112 TestingPrefServiceSimple prefs_; |
113 MockPolicyService policy_service_; | 113 MockPolicyService policy_service_; |
114 PolicyMap policy_map_; | 114 PolicyMap policy_map_; |
115 | 115 |
116 scoped_refptr<base::TestSimpleTaskRunner> task_runner_; | 116 scoped_refptr<base::TestSimpleTaskRunner> task_runner_; |
117 scoped_ptr<TestPolicyStatisticsCollector> policy_statistics_collector_; | 117 scoped_ptr<TestPolicyStatisticsCollector> policy_statistics_collector_; |
118 }; | 118 }; |
119 | 119 |
120 TEST_F(PolicyStatisticsCollectorTest, CollectPending) { | 120 TEST_F(PolicyStatisticsCollectorTest, CollectPending) { |
121 SetPolicy(kTestPolicy1); | 121 SetPolicy(kTestPolicy1); |
122 | 122 |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 EXPECT_CALL(*policy_statistics_collector_.get(), | 167 EXPECT_CALL(*policy_statistics_collector_.get(), |
168 RecordPolicyUse(test_policy_id1_)); | 168 RecordPolicyUse(test_policy_id1_)); |
169 EXPECT_CALL(*policy_statistics_collector_.get(), | 169 EXPECT_CALL(*policy_statistics_collector_.get(), |
170 RecordPolicyUse(test_policy_id2_)); | 170 RecordPolicyUse(test_policy_id2_)); |
171 | 171 |
172 policy_statistics_collector_->Initialize(); | 172 policy_statistics_collector_->Initialize(); |
173 EXPECT_EQ(1u, task_runner_->GetPendingTasks().size()); | 173 EXPECT_EQ(1u, task_runner_->GetPendingTasks().size()); |
174 } | 174 } |
175 | 175 |
176 } // namespace policy | 176 } // namespace policy |
OLD | NEW |