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

Side by Side Diff: device/u2f/mock_u2f_device.h

Issue 2821263005: Add U2F request state machines (Closed)
Patch Set: Add U2fRequest, U2fSign, and U2fRegister classes Created 3 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
OLDNEW
(Empty)
1 // Copyright 2017 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 #ifndef DEVICE_U2F_MOCK_U2F_DEVICE_H_
6 #define DEVICE_U2F_MOCK_U2F_DEVICE_H_
7
8 #include <vector>
9
10 #include "base/memory/ptr_util.h"
11 #include "testing/gmock/include/gmock/gmock.h"
12 #include "u2f_device.h"
13
14 namespace device {
15
16 class MockU2fDevice : public U2fDevice {
17 public:
18 static constexpr uint8_t kSign = 0x1;
19 static constexpr uint8_t kRegister = 0x5;
20
21 MockU2fDevice();
22 ~MockU2fDevice() override;
23
24 MOCK_METHOD1(TryWink, void(const WinkCallback& cb));
25 MOCK_METHOD0(GetId, std::string(void));
26 // GMock cannot mock a method taking a std::unique_ptr<T>
27 MOCK_METHOD2(DeviceTransactPtr,
28 void(U2fApduCommand* command, const DeviceCallback& cb));
29 void DeviceTransact(std::unique_ptr<U2fApduCommand> command,
30 const DeviceCallback& cb) override;
31 static void TransactNoError(std::unique_ptr<U2fApduCommand> command,
32 const DeviceCallback& cb);
33 static void NotSatisfied(U2fApduCommand* cmd, const DeviceCallback& cb);
34 static void WrongData(U2fApduCommand* cmd, const DeviceCallback& cb);
35 static void NoErrorSign(U2fApduCommand* cmd, const DeviceCallback& cb);
36 static void NoErrorRegister(U2fApduCommand* cmd, const DeviceCallback& cb);
37 static void WinkDoNothing(const WinkCallback& cb);
38 };
39
40 } // namespace device
41
42 #endif // DEVICE_U2F_MOCK_U2F_DEVICE_H_
OLDNEW
« no previous file with comments | « device/u2f/BUILD.gn ('k') | device/u2f/mock_u2f_device.cc » ('j') | device/u2f/u2f_register.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698