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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chromeos/attestation/mock_attestation_flow.h ('k') | chromeos/chromeos.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/attestation/mock_attestation_flow.cc
diff --git a/chromeos/attestation/mock_attestation_flow.cc b/chromeos/attestation/mock_attestation_flow.cc
new file mode 100644
index 0000000000000000000000000000000000000000..71de13e17860bfb604fc5ad8c87a0f4421463c12
--- /dev/null
+++ b/chromeos/attestation/mock_attestation_flow.cc
@@ -0,0 +1,46 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chromeos/attestation/mock_attestation_flow.h"
+
+#include "testing/gmock/include/gmock/gmock.h"
+
+using testing::_;
+using testing::Invoke;
+
+namespace chromeos {
+namespace attestation {
+
+FakeServerProxy::FakeServerProxy() : result_(true) {}
+
+FakeServerProxy::~FakeServerProxy() {}
+
+void FakeServerProxy::SendEnrollRequest(const std::string& request,
+ const DataCallback& callback) {
+ callback.Run(result_, request + "_response");
+}
+
+void FakeServerProxy::SendCertificateRequest(const std::string& request,
+ const DataCallback& callback) {
+ callback.Run(result_, request + "_response");
+}
+
+MockServerProxy::MockServerProxy() {}
+
+MockServerProxy::~MockServerProxy() {}
+
+void MockServerProxy::DeferToFake(bool success) {
+ fake_.set_result(success);
+ ON_CALL(*this, SendEnrollRequest(_, _))
+ .WillByDefault(Invoke(&fake_, &FakeServerProxy::SendEnrollRequest));
+ ON_CALL(*this, SendCertificateRequest(_, _))
+ .WillByDefault(Invoke(&fake_, &FakeServerProxy::SendCertificateRequest));
+}
+
+MockObserver::MockObserver() {}
+
+MockObserver::~MockObserver() {}
+
+} // namespace attestation
+} // namespace chromeos
« 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