OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/login/signed_settings.h" | 5 #include "chrome/browser/chromeos/login/signed_settings.h" |
6 | 6 |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/memory/scoped_temp_dir.h" | 9 #include "base/memory/scoped_temp_dir.h" |
10 #include "base/stringprintf.h" | 10 #include "base/stringprintf.h" |
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
483 | 483 |
484 TEST_F(SignedSettingsTest, StorePropertyFailed) { | 484 TEST_F(SignedSettingsTest, StorePropertyFailed) { |
485 FailingStorePropertyOp(OwnerManager::OPERATION_FAILED); | 485 FailingStorePropertyOp(OwnerManager::OPERATION_FAILED); |
486 } | 486 } |
487 | 487 |
488 TEST_F(SignedSettingsTest, RetrieveProperty) { | 488 TEST_F(SignedSettingsTest, RetrieveProperty) { |
489 em::PolicyData fake_pol = BuildPolicyData(std::vector<std::string>()); | 489 em::PolicyData fake_pol = BuildPolicyData(std::vector<std::string>()); |
490 DoRetrieveProperty(fake_prop_, fake_value_, &fake_pol); | 490 DoRetrieveProperty(fake_prop_, fake_value_, &fake_pol); |
491 } | 491 } |
492 | 492 |
| 493 TEST_F(SignedSettingsTest, RetrieveOwnerProperty) { |
| 494 em::PolicyData fake_pol = BuildPolicyData(std::vector<std::string>()); |
| 495 fake_pol.set_username(fake_email_); |
| 496 DoRetrieveProperty(kDeviceOwner, fake_email_, &fake_pol); |
| 497 } |
| 498 |
493 TEST_F(SignedSettingsTest, ExplicitlyAllowNewUsers) { | 499 TEST_F(SignedSettingsTest, ExplicitlyAllowNewUsers) { |
494 em::PolicyData fake_pol = BuildPolicyData(std::vector<std::string>()); | 500 em::PolicyData fake_pol = BuildPolicyData(std::vector<std::string>()); |
495 SetAllowNewUsers(true, &fake_pol); | 501 SetAllowNewUsers(true, &fake_pol); |
496 DoRetrieveProperty(kAccountsPrefAllowNewUser, "true", &fake_pol); | 502 DoRetrieveProperty(kAccountsPrefAllowNewUser, "true", &fake_pol); |
497 } | 503 } |
498 | 504 |
499 TEST_F(SignedSettingsTest, ExplicitlyDisallowNewUsers) { | 505 TEST_F(SignedSettingsTest, ExplicitlyDisallowNewUsers) { |
500 std::vector<std::string> whitelist(1, fake_email_ + "m"); | 506 std::vector<std::string> whitelist(1, fake_email_ + "m"); |
501 em::PolicyData fake_pol = BuildPolicyData(whitelist); | 507 em::PolicyData fake_pol = BuildPolicyData(whitelist); |
502 SetAllowNewUsers(false, &fake_pol); | 508 SetAllowNewUsers(false, &fake_pol); |
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
785 | 791 |
786 s->Execute(); | 792 s->Execute(); |
787 message_loop_.RunAllPending(); | 793 message_loop_.RunAllPending(); |
788 UnMockLoginLib(); | 794 UnMockLoginLib(); |
789 | 795 |
790 s->OnKeyOpComplete(OwnerManager::OPERATION_FAILED, std::vector<uint8>()); | 796 s->OnKeyOpComplete(OwnerManager::OPERATION_FAILED, std::vector<uint8>()); |
791 message_loop_.RunAllPending(); | 797 message_loop_.RunAllPending(); |
792 } | 798 } |
793 | 799 |
794 } // namespace chromeos | 800 } // namespace chromeos |
OLD | NEW |