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 23 matching lines...) Expand all Loading... |
34 | 34 |
35 void SetUp() override { | 35 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("", |
45 &cloud_policy_store_, | 45 &cloud_policy_store_, |
46 loop_.message_loop_proxy(), | 46 loop_.message_loop_proxy(), |
47 loop_.message_loop_proxy(), | 47 loop_.message_loop_proxy(), |
48 loop_.message_loop_proxy())); | 48 loop_.message_loop_proxy())); |
49 } | 49 } |
50 | 50 |
51 void TearDown() override { | 51 void TearDown() override { |
52 TestingBrowserProcess::GetGlobal()->SetBrowserPolicyConnector(NULL); | 52 TestingBrowserProcess::GetGlobal()->SetBrowserPolicyConnector(NULL); |
53 cloud_policy_manager_->Shutdown(); | 53 cloud_policy_manager_->Shutdown(); |
54 } | 54 } |
(...skipping 48 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 |