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

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

Issue 6821075: Chrome-side lockbox bindings (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: CL RC1. 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
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/ownership_service.h" 5 #include "chrome/browser/chromeos/login/ownership_service.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/crypto/rsa_private_key.h" 9 #include "base/crypto/rsa_private_key.h"
10 #include "base/file_path.h" 10 #include "base/file_path.h"
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 82
83 TEST_F(OwnershipServiceTest, IsOwned) { 83 TEST_F(OwnershipServiceTest, IsOwned) {
84 EXPECT_CALL(*mock_, GetOwnerKeyFilePath()) 84 EXPECT_CALL(*mock_, GetOwnerKeyFilePath())
85 .WillRepeatedly(Return(tmpfile_)); 85 .WillRepeatedly(Return(tmpfile_));
86 EXPECT_TRUE(service_->IsAlreadyOwned()); 86 EXPECT_TRUE(service_->IsAlreadyOwned());
87 } 87 }
88 88
89 TEST_F(OwnershipServiceTest, IsOwnershipTaken) { 89 TEST_F(OwnershipServiceTest, IsOwnershipTaken) {
90 EXPECT_CALL(*mock_, GetOwnerKeyFilePath()) 90 EXPECT_CALL(*mock_, GetOwnerKeyFilePath())
91 .WillRepeatedly(Return(tmpfile_)); 91 .WillRepeatedly(Return(tmpfile_));
92 EXPECT_TRUE(service_->GetStatus(true) == OwnershipService::OWNERSHIP_TAKEN); 92 EXPECT_TRUE(service_->GetStatus(true) == OwnershipService::OWNERSHIP_USER);
93 } 93 }
94 94
95 TEST_F(OwnershipServiceTest, IsUnowned) { 95 TEST_F(OwnershipServiceTest, IsUnowned) {
96 StartUnowned(); 96 StartUnowned();
97 97
98 EXPECT_CALL(*mock_, GetOwnerKeyFilePath()) 98 EXPECT_CALL(*mock_, GetOwnerKeyFilePath())
99 .WillRepeatedly(Return(tmpfile_)); 99 .WillRepeatedly(Return(tmpfile_));
100 EXPECT_FALSE(service_->IsAlreadyOwned()); 100 EXPECT_FALSE(service_->IsAlreadyOwned());
101 } 101 }
102 102
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 .WillOnce(Return(false)) 207 .WillOnce(Return(false))
208 .RetiresOnSaturation(); 208 .RetiresOnSaturation();
209 209
210 MockKeyUser delegate(OwnerManager::OPERATION_FAILED); 210 MockKeyUser delegate(OwnerManager::OPERATION_FAILED);
211 service_->StartVerifyAttempt(data, sig, &delegate); 211 service_->StartVerifyAttempt(data, sig, &delegate);
212 212
213 message_loop_.Run(); 213 message_loop_.Run();
214 } 214 }
215 215
216 } // namespace chromeos 216 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698