summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/qwebenginepage
diff options
context:
space:
mode:
authorKirill Burtsev <kirill.burtsev@qt.io>2018-08-29 15:19:41 +0200
committerMichael BrĂ¼ning <michael.bruning@qt.io>2018-09-24 10:49:57 +0000
commitfbcf17eae574d59b57ddefc7bd6467e7addf3927 (patch)
tree66b4d0991627a3ab9eb2a87fd6cb3303e70974c9 /tests/auto/widgets/qwebenginepage
parentd44b146e694589cf9b666b9e0bb8367e3817d920 (diff)
Fix QWebEnginePage emit zero loadProgress before loadStarted
Restore expected behavior for QWebEnginePage loading progress. This was missing after queuing progress notification signals change. Add missing state transition to loadSignalsOrder test. Change-Id: Id1d94f8391b83decc8057c5108d2d19c38258965 Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io> Reviewed-by: Michal Klocek <michal.klocek@qt.io>
Diffstat (limited to 'tests/auto/widgets/qwebenginepage')
-rw-r--r--tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp
index 8b36d5a6f..cb6e9e405 100644
--- a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp
+++ b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp
@@ -2216,11 +2216,13 @@ public:
connect(page, SIGNAL(loadProgress(int)), SLOT(onLoadProgress(int)));
QState* waitingForLoadStarted = new QState(this);
+ QState* waitingForFirstLoadProgress = new QState(this);
QState* waitingForLastLoadProgress = new QState(this);
QState* waitingForLoadFinished = new QState(this);
QFinalState* final = new QFinalState(this);
- waitingForLoadStarted->addTransition(page, SIGNAL(loadStarted()), waitingForLastLoadProgress);
+ waitingForLoadStarted->addTransition(page, SIGNAL(loadStarted()), waitingForFirstLoadProgress);
+ waitingForFirstLoadProgress->addTransition(this, SIGNAL(firstLoadProgress()), waitingForLastLoadProgress);
waitingForLastLoadProgress->addTransition(this, SIGNAL(lastLoadProgress()), waitingForLoadFinished);
waitingForLoadFinished->addTransition(page, SIGNAL(loadFinished(bool)), final);
@@ -2234,10 +2236,13 @@ public:
public Q_SLOTS:
void onLoadProgress(int progress)
{
- if (progress == 100)
+ if (progress == 0)
+ emit firstLoadProgress();
+ else if (progress == 100)
emit lastLoadProgress();
}
Q_SIGNALS:
+ void firstLoadProgress();
void lastLoadProgress();
};