blob: 597425bdf8ba84c270507710a6d7daaca9120b0f (
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
// Copyright 2016 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 CHROME_RENDERER_AUTOFILL_FAKE_PASSWORD_GENERATION_DRIVER_H_
#define CHROME_RENDERER_AUTOFILL_FAKE_PASSWORD_GENERATION_DRIVER_H_
#include <string>
#include <vector>
#include "base/optional.h"
#include "base/strings/string16.h"
#include "components/autofill/content/common/mojom/autofill_driver.mojom.h"
#include "components/autofill/core/common/password_form.h"
#include "components/autofill/core/common/password_generation_util.h"
#include "mojo/public/cpp/bindings/associated_receiver.h"
#include "mojo/public/cpp/bindings/pending_associated_receiver.h"
#include "testing/gmock/include/gmock/gmock.h"
class FakePasswordGenerationDriver
: public autofill::mojom::PasswordGenerationDriver {
public:
FakePasswordGenerationDriver();
~FakePasswordGenerationDriver() override;
void BindReceiver(
mojo::PendingAssociatedReceiver<autofill::mojom::PasswordGenerationDriver>
receiver);
void Flush();
// autofill::mojom::PasswordGenerationDriver:
MOCK_METHOD1(GenerationAvailableForForm,
void(const autofill::PasswordForm& password_form));
MOCK_METHOD1(
AutomaticGenerationAvailable,
void(const autofill::password_generation::PasswordGenerationUIData&));
MOCK_METHOD3(ShowPasswordEditingPopup,
void(const gfx::RectF&,
const autofill::PasswordForm&,
uint32_t));
MOCK_METHOD0(PasswordGenerationRejectedByTyping, void());
MOCK_METHOD1(PresaveGeneratedPassword,
void(const autofill::PasswordForm& password_form));
MOCK_METHOD1(PasswordNoLongerGenerated,
void(const autofill::PasswordForm& password_form));
MOCK_METHOD0(FrameWasScrolled, void());
MOCK_METHOD0(GenerationElementLostFocus, void());
private:
mojo::AssociatedReceiver<autofill::mojom::PasswordGenerationDriver> receiver_{
this};
DISALLOW_COPY_AND_ASSIGN(FakePasswordGenerationDriver);
};
#endif // CHROME_RENDERER_AUTOFILL_FAKE_PASSWORD_GENERATION_DRIVER_H_
|