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

Side by Side Diff: chrome/browser/chromeos/attestation/attestation_policy_observer_unittest.cc

Issue 14305009: Enhanced and refactored the AttestationFlow interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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) 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 "base/bind.h" 5 #include "base/bind.h"
6 #include "base/message_loop.h" 6 #include "base/message_loop.h"
7 #include "base/run_loop.h" 7 #include "base/run_loop.h"
8 #include "chrome/browser/chromeos/attestation/attestation_policy_observer.h" 8 #include "chrome/browser/chromeos/attestation/attestation_policy_observer.h"
9 #include "chrome/browser/chromeos/settings/cros_settings.h" 9 #include "chrome/browser/chromeos/settings/cros_settings.h"
10 #include "chrome/browser/chromeos/settings/cros_settings_names.h" 10 #include "chrome/browser/chromeos/settings/cros_settings_names.h"
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 } 94 }
95 95
96 TEST_F(AttestationPolicyObserverTest, UnregisteredPolicyClient) { 96 TEST_F(AttestationPolicyObserverTest, UnregisteredPolicyClient) {
97 policy_client_.SetDMToken(""); 97 policy_client_.SetDMToken("");
98 Run(); 98 Run();
99 } 99 }
100 100
101 TEST_F(AttestationPolicyObserverTest, NewCertificate) { 101 TEST_F(AttestationPolicyObserverTest, NewCertificate) {
102 EXPECT_CALL(cryptohome_client_, TpmAttestationDoesKeyExist(_, _, _)) 102 EXPECT_CALL(cryptohome_client_, TpmAttestationDoesKeyExist(_, _, _))
103 .WillOnce(WithArgs<2>(Invoke(DBusCallbackFalse))); 103 .WillOnce(WithArgs<2>(Invoke(DBusCallbackFalse)));
104 EXPECT_CALL(attestation_flow_, GetCertificate(_, _)) 104 EXPECT_CALL(attestation_flow_, GetCertificate(_, _, _))
105 .WillOnce(WithArgs<1>(Invoke(CertCallbackSuccess))); 105 .WillOnce(WithArgs<2>(Invoke(CertCallbackSuccess)));
106 Run(); 106 Run();
107 } 107 }
108 108
109 TEST_F(AttestationPolicyObserverTest, KeyExists) { 109 TEST_F(AttestationPolicyObserverTest, KeyExists) {
110 EXPECT_CALL(cryptohome_client_, TpmAttestationDoesKeyExist(_, _, _)) 110 EXPECT_CALL(cryptohome_client_, TpmAttestationDoesKeyExist(_, _, _))
111 .WillOnce(WithArgs<2>(Invoke(DBusCallbackTrue))); 111 .WillOnce(WithArgs<2>(Invoke(DBusCallbackTrue)));
112 EXPECT_CALL(cryptohome_client_, TpmAttestationGetCertificate(_, _, _)) 112 EXPECT_CALL(cryptohome_client_, TpmAttestationGetCertificate(_, _, _))
113 .WillOnce(WithArgs<2>(Invoke(DBusDataCallback))); 113 .WillOnce(WithArgs<2>(Invoke(DBusDataCallback)));
114 Run(); 114 Run();
115 } 115 }
116 116
117 } // namespace attestation 117 } // namespace attestation
118 } // namespace chromeos 118 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698