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 <map> | 5 #include <map> |
6 #include <string> | 6 #include <string> |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 base::MessageLoop::current()->PostTask(FROM_HERE, | 123 base::MessageLoop::current()->PostTask(FROM_HERE, |
124 base::Bind(&chrome::AttemptExit)); | 124 base::Bind(&chrome::AttemptExit)); |
125 base::RunLoop().RunUntilIdle(); | 125 base::RunLoop().RunUntilIdle(); |
126 } | 126 } |
127 | 127 |
128 void RemoveOwnerPrivateKeyFromPolicyBuilders() { | 128 void RemoveOwnerPrivateKeyFromPolicyBuilders() { |
129 // Any instances of the private half of the owner key held by policy | 129 // Any instances of the private half of the owner key held by policy |
130 // builders must be dropped as otherwise the NSS library will tell Chrome | 130 // builders must be dropped as otherwise the NSS library will tell Chrome |
131 // that the key is available - which is incorrect and leads to Chrome | 131 // that the key is available - which is incorrect and leads to Chrome |
132 // behaving as if a local owner were logged in. | 132 // behaving as if a local owner were logged in. |
133 device_policy()->set_signing_key(scoped_ptr<crypto::RSAPrivateKey>(NULL)); | 133 device_policy()->set_signing_key(scoped_ptr<crypto::RSAPrivateKey>()); |
134 device_policy()->set_new_signing_key( | 134 device_policy()->set_new_signing_key(scoped_ptr<crypto::RSAPrivateKey>()); |
135 scoped_ptr<crypto::RSAPrivateKey>(NULL)); | |
136 device_local_account_policy_.set_signing_key( | 135 device_local_account_policy_.set_signing_key( |
137 scoped_ptr<crypto::RSAPrivateKey>(NULL)); | 136 scoped_ptr<crypto::RSAPrivateKey>()); |
138 device_local_account_policy_.set_new_signing_key( | 137 device_local_account_policy_.set_new_signing_key( |
139 scoped_ptr<crypto::RSAPrivateKey>(NULL)); | 138 scoped_ptr<crypto::RSAPrivateKey>()); |
140 } | 139 } |
141 | 140 |
142 void InitializePolicy() { | 141 void InitializePolicy() { |
143 device_policy()->policy_data().set_public_key_version(1); | 142 device_policy()->policy_data().set_public_key_version(1); |
144 em::ChromeDeviceSettingsProto& proto(device_policy()->payload()); | 143 em::ChromeDeviceSettingsProto& proto(device_policy()->payload()); |
145 proto.mutable_show_user_names()->set_show_user_names(true); | 144 proto.mutable_show_user_names()->set_show_user_names(true); |
146 | 145 |
147 device_local_account_policy_.policy_data().set_policy_type( | 146 device_local_account_policy_.policy_data().set_policy_type( |
148 dm_protocol::kChromePublicAccountPolicyType); | 147 dm_protocol::kChromePublicAccountPolicyType); |
149 device_local_account_policy_.policy_data().set_username(kAccountId1); | 148 device_local_account_policy_.policy_data().set_username(kAccountId1); |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
385 // Verify that the Terms of Service screen is being shown. | 384 // Verify that the Terms of Service screen is being shown. |
386 chromeos::WizardController* wizard_controller = | 385 chromeos::WizardController* wizard_controller = |
387 chromeos::WizardController::default_controller(); | 386 chromeos::WizardController::default_controller(); |
388 ASSERT_TRUE(wizard_controller); | 387 ASSERT_TRUE(wizard_controller); |
389 ASSERT_TRUE(wizard_controller->current_screen()); | 388 ASSERT_TRUE(wizard_controller->current_screen()); |
390 EXPECT_EQ(chromeos::WizardController::kTermsOfServiceScreenName, | 389 EXPECT_EQ(chromeos::WizardController::kTermsOfServiceScreenName, |
391 wizard_controller->current_screen()->GetName()); | 390 wizard_controller->current_screen()->GetName()); |
392 } | 391 } |
393 | 392 |
394 } // namespace policy | 393 } // namespace policy |
OLD | NEW |