mailwebengineaccesskeyanchorfromhtmltest.h 1.7 KB
Newer Older
Laurent Montel's avatar
Laurent Montel committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/*
  Copyright (c) 2016 Montel Laurent <montel@kde.org>

  This program is free software; you can redistribute it and/or modify it
  under the terms of the GNU General Public License, version 2, as
  published by the Free Software Foundation.

  This program is distributed in the hope that it will be useful, but
  WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  General Public License for more details.

  You should have received a copy of the GNU General Public License along
  with this program; if not, write to the Free Software Foundation, Inc.,
  51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
*/

#ifndef MAILWEBENGINEACCESSKEYANCHORFROMHTMLTEST_H
#define MAILWEBENGINEACCESSKEYANCHORFROMHTMLTEST_H

#include <QObject>
Laurent Montel's avatar
Laurent Montel committed
22
#include <QWidget>
Laurent Montel's avatar
Laurent Montel committed
23
24

#include "../mailwebengineaccesskeyanchor.h"
Laurent Montel's avatar
Laurent Montel committed
25
26
27
28
29
30
31
32
33
34
35
36
37
38
class QWebEngineView;
class TestWebEngineAccessKey : public QWidget
{
    Q_OBJECT
public:
    explicit TestWebEngineAccessKey(QWidget *parent = Q_NULLPTR);
    ~TestWebEngineAccessKey();

    void setHtml(const QString &html);
private Q_SLOTS:
    void loadFinished(bool b);

    void handleSearchAccessKey(const QVariant &var);
Q_SIGNALS:
Laurent Montel's avatar
Laurent Montel committed
39
    void accessKeySearchFinished(const QVector<MessageViewer::MailWebEngineAccessKeyAnchor> &var);
Laurent Montel's avatar
Laurent Montel committed
40
41
42
43

private:
    QWebEngineView *mEngineView;
};
Laurent Montel's avatar
Laurent Montel committed
44
45
46
47
48
49

class MailWebEngineAccessKeyAnchorFromHtmlTest : public QObject
{
    Q_OBJECT
public:
    explicit MailWebEngineAccessKeyAnchorFromHtmlTest(QObject *parent = Q_NULLPTR);
Laurent Montel's avatar
Laurent Montel committed
50
51
private Q_SLOTS:
    void shouldNotShowAccessKeyWhenHtmlAsNotAnchor();
Laurent Montel's avatar
Laurent Montel committed
52
    void shouldReturnOneAnchor();
Laurent Montel's avatar
Laurent Montel committed
53
    void shouldReturnTwoAnchor();
Laurent Montel's avatar
Laurent Montel committed
54
55
56
};

#endif // MAILWEBENGINEACCESSKEYANCHORFROMHTMLTEST_H