1
mirror of https://invent.kde.org/network/falkon.git synced 2024-09-21 09:42:10 +02:00
falkonOfficial/autotests/qml/qmltopsitesapitest.cpp
Juraj Oravec 9eaffd1208 Autotests Qml - fix compilation with Qt 5.9
Summary: BUG: 411197

Test Plan: Compile with Qt 5.9, e.g. on Ubuntu 18.04

Reviewers: #falkon, drosca

Reviewed By: #falkon, drosca

Subscribers: drosca, falkon

Tags: #falkon

Differential Revision: https://phabricator.kde.org/D27102
2020-02-02 18:17:57 +01:00

45 lines
1.6 KiB
C++

/* ============================================================
* Falkon - Qt web browser
* Copyright (C) 2018 Anmol Gautam <tarptaeya@gmail.com>
*
* 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 3 of the License, or
* (at your option) any later version.
*
* 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 "qmltopsitesapitest.h"
#include "autotests.h"
#include "qmltesthelper.h"
#include "mainapplication.h"
#include "pluginproxy.h"
#include "speeddial.h"
void QmlTopSitesApiTest::initTestCase()
{
}
void QmlTopSitesApiTest::cleanupTestCase()
{
}
void QmlTopSitesApiTest::testTopSites()
{
mApp->plugins()->speedDial()->addPage(QUrl("https://example.com"), "Example Domain");
auto list = m_testHelper.evaluate("Falkon.TopSites.get()").toVariant().toList();
QCOMPARE(list.length(), 1);
QObject* object = qvariant_cast<QObject*>(list.at(0));
QVERIFY(object);
QCOMPARE(object->property("title").toString(), QSL("Example Domain"));
QCOMPARE(object->property("url").toString(), QSL("https://example.com"));
}
FALKONTEST_MAIN(QmlTopSitesApiTest)