diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2017-12-13 12:44:17 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2017-12-14 10:51:21 +0000 |
commit | 20d44c1d3f2f07c582d6044f2f013218795c8a29 (patch) | |
tree | 340a402a327b9e1ceaeb1aa0dfa7b98e98e2da25 /tests | |
parent | c4bc2f830d62ead99ca1d681992f1efafa7f70d6 (diff) |
Rename qwebenginehistoryinterface test
We have no qwebenginehistoryinterface and the test does basically
nothing, however since it exposes problems at shutdown we can keep the
test as an very fast test just to check fast shutdown work.
Change-Id: I612ac79fad788fe3835789fcfba11647f43a8796
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/widgets/qwebenginehistoryinterface/tst_qwebenginehistoryinterface.cpp | 106 | ||||
-rw-r--r-- | tests/auto/widgets/qwebengineshutdown/qwebengineshutdown.pro (renamed from tests/auto/widgets/qwebenginehistoryinterface/qwebenginehistoryinterface.pro) | 0 | ||||
-rw-r--r-- | tests/auto/widgets/qwebengineshutdown/tst_qwebengineshutdown.cpp | 95 | ||||
-rw-r--r-- | tests/auto/widgets/widgets.pro | 2 |
4 files changed, 96 insertions, 107 deletions
diff --git a/tests/auto/widgets/qwebenginehistoryinterface/tst_qwebenginehistoryinterface.cpp b/tests/auto/widgets/qwebenginehistoryinterface/tst_qwebenginehistoryinterface.cpp deleted file mode 100644 index 4666d1ba4..000000000 --- a/tests/auto/widgets/qwebenginehistoryinterface/tst_qwebenginehistoryinterface.cpp +++ /dev/null @@ -1,106 +0,0 @@ -/* - Copyright (C) 2008 Holger Hans Peter Freyther - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - - -#include <QtTest/QtTest> - -#include <qwebenginepage.h> -#include <qwebengineview.h> -#if defined(QWEBENGINEHISTORYINTERFACE) -#include <qwebenginehistoryinterface.h> -#endif -#include <QDebug> - -class tst_QWebEngineHistoryInterface : public QObject -{ - Q_OBJECT - -public: - tst_QWebEngineHistoryInterface(); - virtual ~tst_QWebEngineHistoryInterface(); - -public Q_SLOTS: - void initTestCase(); - void init(); - void cleanup(); - -private Q_SLOTS: - void visitedLinks(); - -private: - - -private: - QWebEngineView* m_view; - QWebEnginePage* m_page; -}; - -tst_QWebEngineHistoryInterface::tst_QWebEngineHistoryInterface() -{ -} - -tst_QWebEngineHistoryInterface::~tst_QWebEngineHistoryInterface() -{ -} - -void tst_QWebEngineHistoryInterface::initTestCase() -{ -} - -void tst_QWebEngineHistoryInterface::init() -{ - m_view = new QWebEngineView(); - m_page = m_view->page(); -} - -void tst_QWebEngineHistoryInterface::cleanup() -{ - delete m_view; -} - -#if defined(QWEBENGINEHISTORYINTERFACE) -class FakeHistoryImplementation : public QWebEngineHistoryInterface { -public: - void addHistoryEntry(const QString&) {} - bool historyContains(const QString& url) const { - return url == QLatin1String("http://www.trolltech.com/"); - } -}; -#endif - -/* - * Test that visited links are properly colored. http://www.trolltech.com is marked - * as visited, so the below website should have exactly one element in the a:visited - * state. - */ -void tst_QWebEngineHistoryInterface::visitedLinks() -{ -#if !defined(QWEBENGINEELEMENT) - QSKIP("QWEBENGINEELEMENT"); -#else - QWebEngineHistoryInterface::setDefaultInterface(new FakeHistoryImplementation); - m_view->setHtml("<html><style>:link{color:green}:visited{color:red}</style><body><a href='http://www.trolltech.com' id='vlink'>Trolltech</a></body></html>"); - QWebEngineElement anchor = m_view->page()->mainFrame()->findFirstElement("a[id=vlink]"); - QString linkColor = anchor.styleProperty("color", QWebEngineElement::ComputedStyle); - QCOMPARE(linkColor, QString::fromLatin1("rgb(255, 0, 0)")); -#endif -} - -QTEST_MAIN(tst_QWebEngineHistoryInterface) -#include "tst_qwebenginehistoryinterface.moc" diff --git a/tests/auto/widgets/qwebenginehistoryinterface/qwebenginehistoryinterface.pro b/tests/auto/widgets/qwebengineshutdown/qwebengineshutdown.pro index e99c7f493..e99c7f493 100644 --- a/tests/auto/widgets/qwebenginehistoryinterface/qwebenginehistoryinterface.pro +++ b/tests/auto/widgets/qwebengineshutdown/qwebengineshutdown.pro diff --git a/tests/auto/widgets/qwebengineshutdown/tst_qwebengineshutdown.cpp b/tests/auto/widgets/qwebengineshutdown/tst_qwebengineshutdown.cpp new file mode 100644 index 000000000..d757e0d60 --- /dev/null +++ b/tests/auto/widgets/qwebengineshutdown/tst_qwebengineshutdown.cpp @@ -0,0 +1,95 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the QtWebEngine module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + + +#include <QtTest/QtTest> + +#include <qwebenginepage.h> +#include <qwebengineview.h> +#include <QDebug> + +class tst_QWebEngineShutdown : public QObject +{ + Q_OBJECT + +public: + tst_QWebEngineShutdown(); + virtual ~tst_QWebEngineShutdown(); + +public Q_SLOTS: + void init(); + void cleanup(); + +private Q_SLOTS: + void dummyTest(); + +private: + + +private: + QWebEngineView* m_view; + QWebEnginePage* m_page; +}; + +tst_QWebEngineShutdown::tst_QWebEngineShutdown() +{ +} + +tst_QWebEngineShutdown::~tst_QWebEngineShutdown() +{ +} + +void tst_QWebEngineShutdown::init() +{ + m_view = new QWebEngineView(); + m_page = m_view->page(); +} + +void tst_QWebEngineShutdown::cleanup() +{ + delete m_view; +} + +void tst_QWebEngineShutdown::dummyTest() +{ + QVERIFY(m_view); +} + +QTEST_MAIN(tst_QWebEngineShutdown) +#include "tst_qwebengineshutdown.moc" diff --git a/tests/auto/widgets/widgets.pro b/tests/auto/widgets/widgets.pro index 32a7806fe..c414e99f2 100644 --- a/tests/auto/widgets/widgets.pro +++ b/tests/auto/widgets/widgets.pro @@ -8,11 +8,11 @@ SUBDIRS += \ qwebenginefaviconmanager \ qwebenginepage \ qwebenginehistory \ - qwebenginehistoryinterface \ qwebengineinspector \ qwebengineprofile \ qwebenginescript \ qwebenginesettings \ + qwebengineshutdown \ qwebengineview qtConfig(accessibility) { |