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

Side by Side Diff: chromeos/attestation/mock_attestation_flow.cc

Issue 11932004: Implemented attestation message flow for Chrome OS. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 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 | « chromeos/attestation/mock_attestation_flow.h ('k') | chromeos/chromeos.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chromeos/attestation/mock_attestation_flow.h"
6
7 #include "testing/gmock/include/gmock/gmock.h"
8
9 using testing::_;
10 using testing::Invoke;
11
12 namespace chromeos {
13 namespace attestation {
14
15 FakeServerProxy::FakeServerProxy() : result_(true) {}
16
17 FakeServerProxy::~FakeServerProxy() {}
18
19 void FakeServerProxy::SendEnrollRequest(const std::string& request,
20 const DataCallback& callback) {
21 callback.Run(result_, request + "_response");
22 }
23
24 void FakeServerProxy::SendCertificateRequest(const std::string& request,
25 const DataCallback& callback) {
26 callback.Run(result_, request + "_response");
27 }
28
29 MockServerProxy::MockServerProxy() {}
30
31 MockServerProxy::~MockServerProxy() {}
32
33 void MockServerProxy::DeferToFake(bool success) {
34 fake_.set_result(success);
35 ON_CALL(*this, SendEnrollRequest(_, _))
36 .WillByDefault(Invoke(&fake_, &FakeServerProxy::SendEnrollRequest));
37 ON_CALL(*this, SendCertificateRequest(_, _))
38 .WillByDefault(Invoke(&fake_, &FakeServerProxy::SendCertificateRequest));
39 }
40
41 MockObserver::MockObserver() {}
42
43 MockObserver::~MockObserver() {}
44
45 } // namespace attestation
46 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/attestation/mock_attestation_flow.h ('k') | chromeos/chromeos.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698