/* * Copyright (C) 2012 Felix Geyer * * 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 . */ #include "TestAutoType.h" #include #include #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(loader.instance()); QVERIFY(m_platform); m_test = qobject_cast(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)