| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 <vector> | 5 #include <vector> |
| 6 | 6 |
| 7 #include "base/json/json_reader.h" | 7 #include "base/json/json_reader.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/browser/policy/browser_policy_connector.h" | 10 #include "chrome/browser/policy/browser_policy_connector.h" |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 | 98 |
| 99 PolicyUITest::PolicyUITest() { | 99 PolicyUITest::PolicyUITest() { |
| 100 } | 100 } |
| 101 | 101 |
| 102 PolicyUITest::~PolicyUITest() { | 102 PolicyUITest::~PolicyUITest() { |
| 103 } | 103 } |
| 104 | 104 |
| 105 void PolicyUITest::SetUpInProcessBrowserTestFixture() { | 105 void PolicyUITest::SetUpInProcessBrowserTestFixture() { |
| 106 EXPECT_CALL(provider_, IsInitializationComplete(_)) | 106 EXPECT_CALL(provider_, IsInitializationComplete(_)) |
| 107 .WillRepeatedly(Return(true)); | 107 .WillRepeatedly(Return(true)); |
| 108 EXPECT_CALL(provider_, RegisterPolicyDomain(_, _)).Times(AnyNumber()); | 108 EXPECT_CALL(provider_, RegisterPolicyDomain(_)).Times(AnyNumber()); |
| 109 policy::BrowserPolicyConnector::SetPolicyProviderForTesting(&provider_); | 109 policy::BrowserPolicyConnector::SetPolicyProviderForTesting(&provider_); |
| 110 } | 110 } |
| 111 | 111 |
| 112 void PolicyUITest::UpdateProviderPolicy(const policy::PolicyMap& policy) { | 112 void PolicyUITest::UpdateProviderPolicy(const policy::PolicyMap& policy) { |
| 113 provider_.UpdateChromePolicy(policy); | 113 provider_.UpdateChromePolicy(policy); |
| 114 base::RunLoop loop; | 114 base::RunLoop loop; |
| 115 loop.RunUntilIdle(); | 115 loop.RunUntilIdle(); |
| 116 } | 116 } |
| 117 | 117 |
| 118 void PolicyUITest::VerifyPolicies( | 118 void PolicyUITest::VerifyPolicies( |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 expected_policies.begin() + first_unset_position++, | 252 expected_policies.begin() + first_unset_position++, |
| 253 PopulateExpectedPolicy(kUnknownPolicy, | 253 PopulateExpectedPolicy(kUnknownPolicy, |
| 254 expected_values[kUnknownPolicy], | 254 expected_values[kUnknownPolicy], |
| 255 values.Get(kUnknownPolicy), | 255 values.Get(kUnknownPolicy), |
| 256 true)); | 256 true)); |
| 257 | 257 |
| 258 // Retrieve the contents of the policy table from the UI and verify that it | 258 // Retrieve the contents of the policy table from the UI and verify that it |
| 259 // matches the expectation. | 259 // matches the expectation. |
| 260 VerifyPolicies(expected_policies); | 260 VerifyPolicies(expected_policies); |
| 261 } | 261 } |
| OLD | NEW |