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

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

Issue 20873002: Added support for the content protection profile to AttestationFlow. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 years, 4 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 <string> 5 #include <string>
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "chrome/browser/chromeos/attestation/attestation_key_payload.pb.h" 10 #include "chrome/browser/chromeos/attestation/attestation_key_payload.pb.h"
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 .WillOnce(WithArgs<1>(Invoke(StatusCallbackSuccess))); 176 .WillOnce(WithArgs<1>(Invoke(StatusCallbackSuccess)));
177 EXPECT_CALL(cryptohome_client_, 177 EXPECT_CALL(cryptohome_client_,
178 TpmAttestationSetKeyPayload(_, _, payload, _)) 178 TpmAttestationSetKeyPayload(_, _, payload, _))
179 .WillOnce(WithArgs<3>(Invoke(DBusCallbackTrue))); 179 .WillOnce(WithArgs<3>(Invoke(DBusCallbackTrue)));
180 } 180 }
181 181
182 // Setup expected key generations. Again use WillOnce(). Key generation is 182 // Setup expected key generations. Again use WillOnce(). Key generation is
183 // another costly operation and if it gets triggered more than once during 183 // another costly operation and if it gets triggered more than once during
184 // a single pass this indicates a logical problem in the observer. 184 // a single pass this indicates a logical problem in the observer.
185 if (new_key) { 185 if (new_key) {
186 EXPECT_CALL(attestation_flow_, GetCertificate(_, _, _)) 186 EXPECT_CALL(attestation_flow_, GetCertificate(_, _, _, _, _))
187 .WillOnce(WithArgs<2>(Invoke(CertCallbackSuccess))); 187 .WillOnce(WithArgs<4>(Invoke(CertCallbackSuccess)));
188 } 188 }
189 } 189 }
190 190
191 void Run() { 191 void Run() {
192 AttestationPolicyObserver observer(&policy_client_, 192 AttestationPolicyObserver observer(&policy_client_,
193 &cryptohome_client_, 193 &cryptohome_client_,
194 &attestation_flow_); 194 &attestation_flow_);
195 observer.set_retry_delay(0); 195 observer.set_retry_delay(0);
196 base::RunLoop().RunUntilIdle(); 196 base::RunLoop().RunUntilIdle();
197 } 197 }
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 SetupMocks(MOCK_NEW_KEY, ""); 298 SetupMocks(MOCK_NEW_KEY, "");
299 // Simulate a DBus failure. 299 // Simulate a DBus failure.
300 EXPECT_CALL(cryptohome_client_, TpmAttestationDoesKeyExist(_, _, _)) 300 EXPECT_CALL(cryptohome_client_, TpmAttestationDoesKeyExist(_, _, _))
301 .WillOnce(WithArgs<2>(Invoke(DBusCallbackError))) 301 .WillOnce(WithArgs<2>(Invoke(DBusCallbackError)))
302 .WillRepeatedly(WithArgs<2>(Invoke(DBusCallbackFalse))); 302 .WillRepeatedly(WithArgs<2>(Invoke(DBusCallbackFalse)));
303 Run(); 303 Run();
304 } 304 }
305 305
306 } // namespace attestation 306 } // namespace attestation
307 } // namespace chromeos 307 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698