mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-10-01 01:26:01 -04:00
Add missing files for the last commit.
This commit is contained in:
parent
606dbc6eb4
commit
58b6fb36f8
55
tests/TestAutoType.cpp
Normal file
55
tests/TestAutoType.cpp
Normal file
@ -0,0 +1,55 @@
|
||||
/*
|
||||
* Copyright (C) 2012 Felix Geyer <debfx@fobos.de>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 or (at your option)
|
||||
* version 3 of the License.
|
||||
*
|
||||
* 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, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "TestAutoType.h"
|
||||
|
||||
#include <QtCore/QPluginLoader>
|
||||
#include <QtTest/QTest>
|
||||
|
||||
#include "tests.h"
|
||||
#include "core/FilePath.h"
|
||||
#include "crypto/Crypto.h"
|
||||
#include "autotype/AutoType.h"
|
||||
#include "autotype/AutoTypePlatformPlugin.h"
|
||||
#include "autotype/test/AutoTypeTestInterface.h"
|
||||
|
||||
void TestAutoType::initTestCase()
|
||||
{
|
||||
Crypto::init();
|
||||
|
||||
AutoType::createTestInstance();
|
||||
|
||||
QPluginLoader loader(filePath()->pluginPath("keepassx-autotype-test"));
|
||||
loader.setLoadHints(QLibrary::ResolveAllSymbolsHint);
|
||||
QVERIFY(loader.instance());
|
||||
|
||||
m_platform = qobject_cast<AutoTypePlatformInterface*>(loader.instance());
|
||||
QVERIFY(m_platform);
|
||||
|
||||
m_test = qobject_cast<AutoTypeTestInterface*>(loader.instance());
|
||||
QVERIFY(m_test);
|
||||
}
|
||||
|
||||
void TestAutoType::testInternal()
|
||||
{
|
||||
QVERIFY(m_platform->activeWindowTitle().isEmpty());
|
||||
|
||||
m_test->setActiveWindowTitle("Test");
|
||||
QCOMPARE(m_platform->activeWindowTitle(), QString("Test"));
|
||||
}
|
||||
|
||||
QTEST_GUILESS_MAIN(TestAutoType)
|
39
tests/TestAutoType.h
Normal file
39
tests/TestAutoType.h
Normal file
@ -0,0 +1,39 @@
|
||||
/*
|
||||
* Copyright (C) 2012 Felix Geyer <debfx@fobos.de>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 or (at your option)
|
||||
* version 3 of the License.
|
||||
*
|
||||
* 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, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef KEEPASSX_TESTAUTOTYPE_H
|
||||
#define KEEPASSX_TESTAUTOTYPE_H
|
||||
|
||||
#include <QtCore/QObject>
|
||||
|
||||
class AutoTypePlatformInterface;
|
||||
class AutoTypeTestInterface;
|
||||
|
||||
class TestAutoType : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
private Q_SLOTS:
|
||||
void initTestCase();
|
||||
void testInternal();
|
||||
|
||||
private:
|
||||
AutoTypePlatformInterface* m_platform;
|
||||
AutoTypeTestInterface* m_test;
|
||||
};
|
||||
|
||||
#endif // KEEPASSX_TESTAUTOTYPE_H
|
Loading…
Reference in New Issue
Block a user