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 "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/bind_helpers.h" | 9 #include "base/bind_helpers.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 ASSERT_TRUE(op->owner_key().get()); | 66 ASSERT_TRUE(op->owner_key().get()); |
67 ASSERT_TRUE(op->owner_key()->private_key()); | 67 ASSERT_TRUE(op->owner_key()->private_key()); |
68 std::vector<uint8> expected_key; | 68 std::vector<uint8> expected_key; |
69 ASSERT_TRUE(policy_.signing_key()->ExportPrivateKey(&expected_key)); | 69 ASSERT_TRUE(policy_.signing_key()->ExportPrivateKey(&expected_key)); |
70 std::vector<uint8> actual_key; | 70 std::vector<uint8> actual_key; |
71 ASSERT_TRUE(op->owner_key()->private_key()->ExportPrivateKey(&actual_key)); | 71 ASSERT_TRUE(op->owner_key()->private_key()->ExportPrivateKey(&actual_key)); |
72 EXPECT_EQ(expected_key, actual_key); | 72 EXPECT_EQ(expected_key, actual_key); |
73 } | 73 } |
74 | 74 |
75 protected: | 75 protected: |
76 MessageLoop message_loop_; | 76 base::MessageLoop message_loop_; |
77 content::TestBrowserThread ui_thread_; | 77 content::TestBrowserThread ui_thread_; |
78 content::TestBrowserThread file_thread_; | 78 content::TestBrowserThread file_thread_; |
79 | 79 |
80 policy::DevicePolicyBuilder policy_; | 80 policy::DevicePolicyBuilder policy_; |
81 DeviceSettingsTestHelper device_settings_test_helper_; | 81 DeviceSettingsTestHelper device_settings_test_helper_; |
82 scoped_refptr<MockOwnerKeyUtil> owner_key_util_; | 82 scoped_refptr<MockOwnerKeyUtil> owner_key_util_; |
83 | 83 |
84 bool validated_; | 84 bool validated_; |
85 | 85 |
86 private: | 86 private: |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 EXPECT_FALSE(op.policy_data()->has_request_token()); | 280 EXPECT_FALSE(op.policy_data()->has_request_token()); |
281 EXPECT_EQ(policy_.policy_data().username(), op.policy_data()->username()); | 281 EXPECT_EQ(policy_.policy_data().username(), op.policy_data()->username()); |
282 | 282 |
283 // Loaded device settings should match what the operation received. | 283 // Loaded device settings should match what the operation received. |
284 ASSERT_TRUE(op.device_settings().get()); | 284 ASSERT_TRUE(op.device_settings().get()); |
285 EXPECT_EQ(policy_.payload().SerializeAsString(), | 285 EXPECT_EQ(policy_.payload().SerializeAsString(), |
286 op.device_settings()->SerializeAsString()); | 286 op.device_settings()->SerializeAsString()); |
287 } | 287 } |
288 | 288 |
289 } // namespace chromeos | 289 } // namespace chromeos |
OLD | NEW |