aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Tismer <tismer@stackless.com>2017-04-11 15:41:57 +0200
committerChristian Tismer <tismer@stackless.com>2017-04-28 12:20:13 +0000
commit04457b7c819b325ace3311f3f5f6189f4bd9d5da (patch)
treebc4edb8a4efa5b329840090df61ea395d7272ec2
parent2b67a8b4cde915b82743349a092ab5044e454857 (diff)
ensure that QWebEngineView.findText exists
It has been reported that QWebEngineView.findText does not exist, and I could it verify on 2017-02-10 that it really doesn’t exist. Now, the situation seems to have changed. This test should prevend the function from vanishing again. Task-number: PYSIDE-474 Change-Id: I9407099d8e4aeef390d40d3913001b1121a125a3 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
-rw-r--r--tests/CMakeLists.txt2
-rw-r--r--tests/QtWebEngineWidgets/CMakeLists.txt29
-rw-r--r--tests/QtWebEngineWidgets/pyside-474-qtwebengineview.py49
3 files changed, 79 insertions, 1 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index a86f7feb..2dae6fb7 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -75,7 +75,7 @@ else()
#TEST_QT_MODULE(Qt5QuickWidgets_FOUND QtQuickWidgets)
#TEST_QT_MODULE(Qt5WebChannel_FOUND QtWebChannel)
#TEST_QT_MODULE(Qt5WebEngine_FOUND QtWebEngine)
- #TEST_QT_MODULE(Qt5WebEngineWidgets_FOUND QtWebEngineWidgets)
+ TEST_QT_MODULE(Qt5WebEngineWidgets_FOUND QtWebEngineWidgets)
#TEST_QT_MODULE(Qt5WebSockets_FOUND QtWebSockets)
if(UNIX AND NOT APPLE)
diff --git a/tests/QtWebEngineWidgets/CMakeLists.txt b/tests/QtWebEngineWidgets/CMakeLists.txt
new file mode 100644
index 00000000..0276d19a
--- /dev/null
+++ b/tests/QtWebEngineWidgets/CMakeLists.txt
@@ -0,0 +1,29 @@
+#############################################################################
+##
+## Copyright (C) 2017 The Qt Company Ltd.
+## Contact: https://www.qt.io/licensing/
+##
+## This file is part of the test suite of PySide2.
+##
+## $QT_BEGIN_LICENSE:GPL-EXCEPT$
+## 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 General Public License Usage
+## Alternatively, this file may be used under the terms of the GNU
+## General Public License version 3 as published by the Free Software
+## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+## 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-3().0.html.
+##
+## $QT_END_LICENSE$
+##
+#############################################################################
+
+PYSIDE_TEST(pyside-474-qtwebengineview.py)
diff --git a/tests/QtWebEngineWidgets/pyside-474-qtwebengineview.py b/tests/QtWebEngineWidgets/pyside-474-qtwebengineview.py
new file mode 100644
index 00000000..c6114361
--- /dev/null
+++ b/tests/QtWebEngineWidgets/pyside-474-qtwebengineview.py
@@ -0,0 +1,49 @@
+#############################################################################
+##
+## Copyright (C) 2017 The Qt Company Ltd.
+## Contact: https://www.qt.io/licensing/
+##
+## This file is part of the test suite of PySide2.
+##
+## $QT_BEGIN_LICENSE:GPL-EXCEPT$
+## 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 General Public License Usage
+## Alternatively, this file may be used under the terms of the GNU
+## General Public License version 3 as published by the Free Software
+## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+## 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-3().0.html.
+##
+## $QT_END_LICENSE$
+##
+#############################################################################
+
+from __future__ import print_function
+
+import unittest
+
+from PySide2 import QtWidgets
+from PySide2 import QtWebEngineWidgets
+
+class MainTest(unittest.TestCase):
+
+ def test_WebEngineView_findText_exists(self):
+ qApp = (QtWidgets.QApplication.instance() or
+ QtWidgets.QApplication([]))
+ view = QtWebEngineWidgets.QWebEngineView()
+ with self.assertRaises(TypeError):
+ view.findText(123)
+ view.findText("nothing")
+ # we are testing only the existence of the function,
+ # after it suddenly showed up.
+
+if __name__ == '__main__':
+ unittest.main()