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_ = | 60 service_ = OwnerSettingsServiceChromeOSFactory::GetForBrowserContext( |
61 OwnerSettingsServiceChromeOSFactory::GetForProfile(profile_.get()); | 61 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 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 message_loop_.RunUntilIdle(); | 278 message_loop_.RunUntilIdle(); |
279 EXPECT_TRUE(validated_); | 279 EXPECT_TRUE(validated_); |
280 | 280 |
281 // Loaded device settings should match what the operation received. | 281 // Loaded device settings should match what the operation received. |
282 ASSERT_TRUE(op.device_settings().get()); | 282 ASSERT_TRUE(op.device_settings().get()); |
283 EXPECT_EQ(policy_.payload().SerializeAsString(), | 283 EXPECT_EQ(policy_.payload().SerializeAsString(), |
284 op.device_settings()->SerializeAsString()); | 284 op.device_settings()->SerializeAsString()); |
285 } | 285 } |
286 | 286 |
287 } // namespace chromeos | 287 } // namespace chromeos |
OLD | NEW |