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 "chrome/browser/policy/cloud/cloud_policy_service.h" | 5 #include "components/policy/core/common/cloud/cloud_policy_service.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "chrome/browser/policy/cloud/cloud_policy_constants.h" | |
10 #include "chrome/browser/policy/cloud/mock_cloud_policy_client.h" | |
11 #include "chrome/browser/policy/cloud/mock_cloud_policy_store.h" | |
12 #include "chrome/browser/policy/proto/cloud/device_management_backend.pb.h" | 9 #include "chrome/browser/policy/proto/cloud/device_management_backend.pb.h" |
| 10 #include "components/policy/core/common/cloud/cloud_policy_constants.h" |
| 11 #include "components/policy/core/common/cloud/mock_cloud_policy_client.h" |
| 12 #include "components/policy/core/common/cloud/mock_cloud_policy_store.h" |
13 #include "testing/gmock/include/gmock/gmock.h" | 13 #include "testing/gmock/include/gmock/gmock.h" |
14 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
15 | 15 |
16 namespace em = enterprise_management; | 16 namespace em = enterprise_management; |
17 | 17 |
18 using testing::_; | 18 using testing::_; |
19 | 19 |
20 namespace policy { | 20 namespace policy { |
21 | 21 |
22 class MockCloudPolicyServiceObserver : public CloudPolicyService::Observer { | 22 class MockCloudPolicyServiceObserver : public CloudPolicyService::Observer { |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 testing::Mock::VerifyAndClearExpectations(&observer); | 231 testing::Mock::VerifyAndClearExpectations(&observer); |
232 | 232 |
233 // Now, the next time the store is loaded, the observer should not be called | 233 // Now, the next time the store is loaded, the observer should not be called |
234 // again. | 234 // again. |
235 EXPECT_CALL(observer, OnInitializationCompleted(&service_)).Times(0); | 235 EXPECT_CALL(observer, OnInitializationCompleted(&service_)).Times(0); |
236 store_.NotifyStoreLoaded(); | 236 store_.NotifyStoreLoaded(); |
237 service_.RemoveObserver(&observer); | 237 service_.RemoveObserver(&observer); |
238 } | 238 } |
239 | 239 |
240 } // namespace policy | 240 } // namespace policy |
OLD | NEW |