| 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/cloud/user_cloud_policy_manager.h" | 5 #include "components/policy/core/common/cloud/user_cloud_policy_manager.h" |
| 6 | 6 |
| 7 #include "base/callback.h" | 7 #include "base/callback.h" |
| 8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "base/message_loop/message_loop_proxy.h" | 9 #include "base/message_loop/message_loop_proxy.h" |
| 10 #include "base/sequenced_task_runner.h" | 10 #include "base/sequenced_task_runner.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 | 26 |
| 27 namespace policy { | 27 namespace policy { |
| 28 namespace { | 28 namespace { |
| 29 | 29 |
| 30 class UserCloudPolicyManagerTest : public testing::Test { | 30 class UserCloudPolicyManagerTest : public testing::Test { |
| 31 protected: | 31 protected: |
| 32 UserCloudPolicyManagerTest() : store_(NULL) {} | 32 UserCloudPolicyManagerTest() : store_(NULL) {} |
| 33 | 33 |
| 34 virtual void SetUp() OVERRIDE { | 34 virtual void SetUp() OVERRIDE { |
| 35 // Set up a policy map for testing. | 35 // Set up a policy map for testing. |
| 36 policy_map_.Set("key", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, | 36 policy_map_.Set("key", |
| 37 base::Value::CreateStringValue("value"), NULL); | 37 POLICY_LEVEL_MANDATORY, |
| 38 POLICY_SCOPE_USER, |
| 39 new base::StringValue("value"), |
| 40 NULL); |
| 38 expected_bundle_.Get(PolicyNamespace(POLICY_DOMAIN_CHROME, std::string())) | 41 expected_bundle_.Get(PolicyNamespace(POLICY_DOMAIN_CHROME, std::string())) |
| 39 .CopyFrom(policy_map_); | 42 .CopyFrom(policy_map_); |
| 40 } | 43 } |
| 41 | 44 |
| 42 virtual void TearDown() OVERRIDE { | 45 virtual void TearDown() OVERRIDE { |
| 43 if (manager_) { | 46 if (manager_) { |
| 44 manager_->RemoveObserver(&observer_); | 47 manager_->RemoveObserver(&observer_); |
| 45 manager_->Shutdown(); | 48 manager_->Shutdown(); |
| 46 } | 49 } |
| 47 } | 50 } |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 store_->NotifyStoreLoaded(); | 90 store_->NotifyStoreLoaded(); |
| 88 EXPECT_TRUE(expected_bundle_.Equals(manager_->policies())); | 91 EXPECT_TRUE(expected_bundle_.Equals(manager_->policies())); |
| 89 EXPECT_TRUE(manager_->IsInitializationComplete(POLICY_DOMAIN_CHROME)); | 92 EXPECT_TRUE(manager_->IsInitializationComplete(POLICY_DOMAIN_CHROME)); |
| 90 EXPECT_CALL(*store_, Clear()); | 93 EXPECT_CALL(*store_, Clear()); |
| 91 manager_->DisconnectAndRemovePolicy(); | 94 manager_->DisconnectAndRemovePolicy(); |
| 92 EXPECT_FALSE(manager_->core()->service()); | 95 EXPECT_FALSE(manager_->core()->service()); |
| 93 } | 96 } |
| 94 | 97 |
| 95 } // namespace | 98 } // namespace |
| 96 } // namespace policy | 99 } // namespace policy |
| OLD | NEW |