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/settings/session_manager_operation.h" | 5 #include "chrome/browser/chromeos/settings/session_manager_operation.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 validated_(false) { | 50 validated_(false) { |
51 OwnerSettingsServiceChromeOSFactory::GetInstance() | 51 OwnerSettingsServiceChromeOSFactory::GetInstance() |
52 ->SetOwnerKeyUtilForTesting(owner_key_util_); | 52 ->SetOwnerKeyUtilForTesting(owner_key_util_); |
53 } | 53 } |
54 | 54 |
55 virtual void SetUp() override { | 55 virtual void SetUp() override { |
56 policy_.payload().mutable_pinned_apps()->add_app_id("fake-app"); | 56 policy_.payload().mutable_pinned_apps()->add_app_id("fake-app"); |
57 policy_.Build(); | 57 policy_.Build(); |
58 | 58 |
59 profile_.reset(new TestingProfile()); | 59 profile_.reset(new TestingProfile()); |
60 service_ = OwnerSettingsServiceChromeOSFactory::GetForBrowserContext( | 60 service_ = |
61 profile_.get()); | 61 OwnerSettingsServiceChromeOSFactory::GetForProfile(profile_.get()); |
62 } | 62 } |
63 | 63 |
64 MOCK_METHOD2(OnOperationCompleted, | 64 MOCK_METHOD2(OnOperationCompleted, |
65 void(SessionManagerOperation*, DeviceSettingsService::Status)); | 65 void(SessionManagerOperation*, DeviceSettingsService::Status)); |
66 | 66 |
67 void CheckSuccessfulValidation( | 67 void CheckSuccessfulValidation( |
68 policy::DeviceCloudPolicyValidator* validator) { | 68 policy::DeviceCloudPolicyValidator* validator) { |
69 EXPECT_TRUE(validator->success()); | 69 EXPECT_TRUE(validator->success()); |
70 EXPECT_TRUE(validator->payload().get()); | 70 EXPECT_TRUE(validator->payload().get()); |
71 EXPECT_EQ(validator->payload()->SerializeAsString(), | 71 EXPECT_EQ(validator->payload()->SerializeAsString(), |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 policy_.GetBlob()); | 217 policy_.GetBlob()); |
218 ASSERT_TRUE(op.policy_data().get()); | 218 ASSERT_TRUE(op.policy_data().get()); |
219 EXPECT_EQ(policy_.policy_data().SerializeAsString(), | 219 EXPECT_EQ(policy_.policy_data().SerializeAsString(), |
220 op.policy_data()->SerializeAsString()); | 220 op.policy_data()->SerializeAsString()); |
221 ASSERT_TRUE(op.device_settings().get()); | 221 ASSERT_TRUE(op.device_settings().get()); |
222 EXPECT_EQ(policy_.payload().SerializeAsString(), | 222 EXPECT_EQ(policy_.payload().SerializeAsString(), |
223 op.device_settings()->SerializeAsString()); | 223 op.device_settings()->SerializeAsString()); |
224 } | 224 } |
225 | 225 |
226 } // namespace chromeos | 226 } // namespace chromeos |
OLD | NEW |