Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(111)

Side by Side Diff: chrome/browser/chromeos/login/signed_settings_unittest.cc

Issue 6873112: [Chrome OS] Re-enable fetching the owner's name via SignedSettings (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address mattias suggestion Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/chromeos/login/signed_settings.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/signed_settings.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698