summaryrefslogtreecommitdiff
path: root/chromium/components/cryptauth/fake_authenticator.h
blob: 68e1eea449f0dd7349e651cc06a35e3714c2e7bc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// Copyright 2017 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.

#ifndef COMPONENTS_CRYPTAUTH_FAKE_AUTHENTICATOR_H_
#define COMPONENTS_CRYPTAUTH_FAKE_AUTHENTICATOR_H_

#include "base/callback.h"
#include "base/macros.h"
#include "components/cryptauth/authenticator.h"

namespace cryptauth {

// A fake implementation of Authenticator to use in tests.
class FakeAuthenticator : public Authenticator {
 public:
  FakeAuthenticator();
  ~FakeAuthenticator() override;

  // Authenticator:
  void Authenticate(const AuthenticationCallback& callback)
      override;

  AuthenticationCallback last_callback() {
    return last_callback_;
  }

 private:
  AuthenticationCallback last_callback_;

  DISALLOW_COPY_AND_ASSIGN(FakeAuthenticator);
};

}  // namespace cryptauth

#endif  // COMPONENTS_CRYPTAUTH_FAKE_AUTHENTICATOR_H_