summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorValentin Fokin <fokinv@inf.u-szeged.hu>2017-04-18 11:39:31 +0200
committerValentin Fokin <fokinv@inf.u-szeged.hu>2017-06-08 09:27:46 +0000
commitdb8ce3b7e8525cb5f209f9970785b60e09a943fa (patch)
tree06ed2deb8db798b5df1f2272e0438fce9dcf294e /tests
parent1a9a48bbfb0dc3115d4b27704157c9ac0b2b3023 (diff)
Merge loadProgressSignal qml test into loadProgress
tst_loadProgressSignal.qml is a duplicate of tst_loadProgress.qml. Move loadProgressChanged signal check to tst_loadProgress.qml and delete tst_loadProgressSignal.qml. Change-Id: I14821d4979def7b9f1985859384224b8f8111bd6 Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/quick/qmltests/data/tst_loadProgress.qml21
-rw-r--r--tests/auto/quick/qmltests/data/tst_loadProgressSignal.qml60
-rw-r--r--tests/auto/quick/qmltests/qmltests.pro1
3 files changed, 17 insertions, 65 deletions
diff --git a/tests/auto/quick/qmltests/data/tst_loadProgress.qml b/tests/auto/quick/qmltests/data/tst_loadProgress.qml
index 32cd91418..bb85ed8e3 100644
--- a/tests/auto/quick/qmltests/data/tst_loadProgress.qml
+++ b/tests/auto/quick/qmltests/data/tst_loadProgress.qml
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** 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.
@@ -41,15 +41,31 @@ TestWebEngineView {
loadProgressArray.push(webEngineView.loadProgress)
}
+ SignalSpy {
+ id: spyProgress
+ target: webEngineView
+ signalName: "loadProgressChanged"
+ }
+
TestCase {
name: "WebEngineViewLoadProgress"
function test_loadProgress() {
compare(webEngineView.loadProgress, 0)
+ compare(spyProgress.count, 0)
loadProgressArray = []
webEngineView.url = Qt.resolvedUrl("test1.html")
+ // Wait for the first loadProgressChanged signal, which have to be non-negative
+ spyProgress.wait()
+ verify(loadProgressArray[0] >= 0)
+ verify(webEngineView.loadProgress >= 0)
+
+ // Wait for the last loadProgressChanged signal, which have to be 100%
verify(webEngineView.waitForLoadSucceeded())
+ spyProgress.wait()
+ compare(loadProgressArray[loadProgressArray.length - 1], 100)
+ compare(webEngineView.loadProgress, 100)
// Test whether the chromium emits progress numbers in ascending order
var loadProgressMin = 0
@@ -58,9 +74,6 @@ TestWebEngineView {
verify(loadProgressMin <= loadProgress)
loadProgressMin = loadProgress
}
-
- // The progress must be 100% at the end
- compare(loadProgressArray[loadProgressArray.length - 1], 100)
}
}
}
diff --git a/tests/auto/quick/qmltests/data/tst_loadProgressSignal.qml b/tests/auto/quick/qmltests/data/tst_loadProgressSignal.qml
deleted file mode 100644
index f05bb1e3d..000000000
--- a/tests/auto/quick/qmltests/data/tst_loadProgressSignal.qml
+++ /dev/null
@@ -1,60 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 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: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$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-import QtTest 1.0
-import QtWebEngine 1.2
-
-TestWebEngineView {
- id: webEngineView
- width: 400
- height: 300
-
- SignalSpy {
- id: spyProgress
- target: webEngineView
- signalName: "loadProgressChanged"
- }
-
- TestCase {
- name: "WebEngineViewLoadProgressSignal"
-
- function test_loadProgressSignal() {
- compare(spyProgress.count, 0)
- compare(webEngineView.loadProgress, 0)
- webEngineView.url = Qt.resolvedUrl("test1.html")
- spyProgress.wait()
- verify(webEngineView.loadProgress > -1 && webEngineView.loadProgress < 101)
- if (webEngineView.loadProgress > 0 && webEngineView.loadProgress < 100) {
- verify(webEngineView.waitForLoadSucceeded())
- spyProgress.wait()
- compare(webEngineView.loadProgress, 100)
- }
- }
- }
-}
diff --git a/tests/auto/quick/qmltests/qmltests.pro b/tests/auto/quick/qmltests/qmltests.pro
index 40fba4512..e7c5ededc 100644
--- a/tests/auto/quick/qmltests/qmltests.pro
+++ b/tests/auto/quick/qmltests/qmltests.pro
@@ -57,7 +57,6 @@ OTHER_FILES += \
$$PWD/data/tst_loadFail.qml \
$$PWD/data/tst_loadHtml.qml \
$$PWD/data/tst_loadProgress.qml \
- $$PWD/data/tst_loadProgressSignal.qml \
$$PWD/data/tst_loadRecursionCrash.qml \
$$PWD/data/tst_loadUrl.qml \
$$PWD/data/tst_navigationHistory.qml \