| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/chromeos/policy/device_local_account_policy_service.h" | 5 #include "chrome/browser/chromeos/policy/device_local_account_policy_service.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 858 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 869 Mock::VerifyAndClearExpectations(&provider_observer_); | 869 Mock::VerifyAndClearExpectations(&provider_observer_); |
| 870 | 870 |
| 871 PolicyBundle expected_policy_bundle; | 871 PolicyBundle expected_policy_bundle; |
| 872 expected_policy_bundle.Get(PolicyNamespace( | 872 expected_policy_bundle.Get(PolicyNamespace( |
| 873 POLICY_DOMAIN_CHROME, std::string())).CopyFrom(expected_policy_map_); | 873 POLICY_DOMAIN_CHROME, std::string())).CopyFrom(expected_policy_map_); |
| 874 EXPECT_TRUE(expected_policy_bundle.Equals(provider_->policies())); | 874 EXPECT_TRUE(expected_policy_bundle.Equals(provider_->policies())); |
| 875 | 875 |
| 876 // Make sure the Dinosaur game is disabled by default. This ensures the | 876 // Make sure the Dinosaur game is disabled by default. This ensures the |
| 877 // default policies have been set in Public Sessions. | 877 // default policies have been set in Public Sessions. |
| 878 bool allow_dinosaur_game = true; | 878 bool allow_dinosaur_game = true; |
| 879 auto policy_value = | 879 auto* policy_value = |
| 880 provider_->policies() | 880 provider_->policies() |
| 881 .Get(PolicyNamespace(POLICY_DOMAIN_CHROME, std::string())) | 881 .Get(PolicyNamespace(POLICY_DOMAIN_CHROME, std::string())) |
| 882 .GetValue(key::kAllowDinosaurEasterEgg); | 882 .GetValue(key::kAllowDinosaurEasterEgg); |
| 883 EXPECT_TRUE(policy_value && policy_value->GetAsBoolean(&allow_dinosaur_game)); | 883 EXPECT_TRUE(policy_value && policy_value->GetAsBoolean(&allow_dinosaur_game)); |
| 884 EXPECT_FALSE(allow_dinosaur_game); | 884 EXPECT_FALSE(allow_dinosaur_game); |
| 885 | 885 |
| 886 // Policy change should be reported. | 886 // Policy change should be reported. |
| 887 EXPECT_CALL(provider_observer_, OnUpdatePolicy(provider_.get())) | 887 EXPECT_CALL(provider_observer_, OnUpdatePolicy(provider_.get())) |
| 888 .Times(AtLeast(1)); | 888 .Times(AtLeast(1)); |
| 889 device_local_account_policy_.payload() | 889 device_local_account_policy_.payload() |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 983 em::DeviceManagementResponse response; | 983 em::DeviceManagementResponse response; |
| 984 device_local_account_policy_.Build(); | 984 device_local_account_policy_.Build(); |
| 985 response.mutable_policy_response()->add_response()->CopyFrom( | 985 response.mutable_policy_response()->add_response()->CopyFrom( |
| 986 device_local_account_policy_.policy()); | 986 device_local_account_policy_.policy()); |
| 987 request_job->SendResponse(DM_STATUS_SUCCESS, response); | 987 request_job->SendResponse(DM_STATUS_SUCCESS, response); |
| 988 FlushDeviceSettings(); | 988 FlushDeviceSettings(); |
| 989 Mock::VerifyAndClearExpectations(&provider_observer_); | 989 Mock::VerifyAndClearExpectations(&provider_observer_); |
| 990 } | 990 } |
| 991 | 991 |
| 992 } // namespace policy | 992 } // namespace policy |
| OLD | NEW |