| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "components/policy/core/common/forwarding_policy_provider.h" | 5 #include "components/policy/core/common/forwarding_policy_provider.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/values.h" | 10 #include "base/values.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 } // namespace | 36 } // namespace |
| 37 | 37 |
| 38 class ForwardingPolicyProviderTest : public testing::Test { | 38 class ForwardingPolicyProviderTest : public testing::Test { |
| 39 protected: | 39 protected: |
| 40 ForwardingPolicyProviderTest() : forwarding_provider_(&mock_provider_) { | 40 ForwardingPolicyProviderTest() : forwarding_provider_(&mock_provider_) { |
| 41 mock_provider_.Init(); | 41 mock_provider_.Init(); |
| 42 forwarding_provider_.Init(&schema_registry_); | 42 forwarding_provider_.Init(&schema_registry_); |
| 43 forwarding_provider_.AddObserver(&observer_); | 43 forwarding_provider_.AddObserver(&observer_); |
| 44 } | 44 } |
| 45 | 45 |
| 46 virtual ~ForwardingPolicyProviderTest() { | 46 ~ForwardingPolicyProviderTest() override { |
| 47 forwarding_provider_.RemoveObserver(&observer_); | 47 forwarding_provider_.RemoveObserver(&observer_); |
| 48 forwarding_provider_.Shutdown(); | 48 forwarding_provider_.Shutdown(); |
| 49 mock_provider_.Shutdown(); | 49 mock_provider_.Shutdown(); |
| 50 } | 50 } |
| 51 | 51 |
| 52 Schema CreateTestSchema() { | 52 Schema CreateTestSchema() { |
| 53 std::string error; | 53 std::string error; |
| 54 Schema schema = Schema::Parse(kTestSchema, &error); | 54 Schema schema = Schema::Parse(kTestSchema, &error); |
| 55 if (!schema.valid()) | 55 if (!schema.valid()) |
| 56 ADD_FAILURE() << error; | 56 ADD_FAILURE() << error; |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 | 241 |
| 242 EXPECT_CALL(observer_, OnUpdatePolicy(_)); | 242 EXPECT_CALL(observer_, OnUpdatePolicy(_)); |
| 243 copy.reset(new PolicyBundle); | 243 copy.reset(new PolicyBundle); |
| 244 copy->CopyFrom(platform_policy); | 244 copy->CopyFrom(platform_policy); |
| 245 mock_provider_.UpdatePolicy(copy.Pass()); | 245 mock_provider_.UpdatePolicy(copy.Pass()); |
| 246 Mock::VerifyAndClearExpectations(&observer_); | 246 Mock::VerifyAndClearExpectations(&observer_); |
| 247 EXPECT_TRUE(forwarding_provider_.policies().Equals(platform_policy)); | 247 EXPECT_TRUE(forwarding_provider_.policies().Equals(platform_policy)); |
| 248 } | 248 } |
| 249 | 249 |
| 250 } // namespace policy | 250 } // namespace policy |
| OLD | NEW |