| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/profile_policy_connector.h" | 5 #include "chrome/browser/policy/profile_policy_connector.h" |
| 6 | 6 |
| 7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
| 8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
| 9 #include "base/values.h" | 9 #include "base/values.h" |
| 10 #include "chrome/test/base/testing_browser_process.h" | 10 #include "chrome/test/base/testing_browser_process.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 using testing::Return; | 25 using testing::Return; |
| 26 using testing::_; | 26 using testing::_; |
| 27 | 27 |
| 28 namespace policy { | 28 namespace policy { |
| 29 | 29 |
| 30 class ProfilePolicyConnectorTest : public testing::Test { | 30 class ProfilePolicyConnectorTest : public testing::Test { |
| 31 protected: | 31 protected: |
| 32 ProfilePolicyConnectorTest() {} | 32 ProfilePolicyConnectorTest() {} |
| 33 virtual ~ProfilePolicyConnectorTest() {} | 33 virtual ~ProfilePolicyConnectorTest() {} |
| 34 | 34 |
| 35 virtual void SetUp() OVERRIDE { | 35 virtual void SetUp() override { |
| 36 // This must be set up before the TestingBrowserProcess is created. | 36 // This must be set up before the TestingBrowserProcess is created. |
| 37 BrowserPolicyConnector::SetPolicyProviderForTesting(&mock_provider_); | 37 BrowserPolicyConnector::SetPolicyProviderForTesting(&mock_provider_); |
| 38 | 38 |
| 39 EXPECT_CALL(mock_provider_, IsInitializationComplete(_)) | 39 EXPECT_CALL(mock_provider_, IsInitializationComplete(_)) |
| 40 .WillRepeatedly(Return(true)); | 40 .WillRepeatedly(Return(true)); |
| 41 | 41 |
| 42 cloud_policy_store_.NotifyStoreLoaded(); | 42 cloud_policy_store_.NotifyStoreLoaded(); |
| 43 cloud_policy_manager_.reset( | 43 cloud_policy_manager_.reset( |
| 44 new CloudPolicyManager(PolicyNamespaceKey("", ""), | 44 new CloudPolicyManager(PolicyNamespaceKey("", ""), |
| 45 &cloud_policy_store_, | 45 &cloud_policy_store_, |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 value = connector.policy_service()->GetPolicies(chrome_ns).GetValue( | 103 value = connector.policy_service()->GetPolicies(chrome_ns).GetValue( |
| 104 key::kAutoFillEnabled); | 104 key::kAutoFillEnabled); |
| 105 ASSERT_TRUE(value); | 105 ASSERT_TRUE(value); |
| 106 EXPECT_TRUE(base::FundamentalValue(true).Equals(value)); | 106 EXPECT_TRUE(base::FundamentalValue(true).Equals(value)); |
| 107 | 107 |
| 108 // Cleanup. | 108 // Cleanup. |
| 109 connector.Shutdown(); | 109 connector.Shutdown(); |
| 110 } | 110 } |
| 111 | 111 |
| 112 } // namespace policy | 112 } // namespace policy |
| OLD | NEW |