summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2019-07-12 18:36:39 +0200
committerAlexandru Croitor <alexandru.croitor@qt.io>2019-07-15 15:56:28 +0200
commit2227f9086f856223c90e7cca0637853d45b848f2 (patch)
tree2a1ba8f70192691a34d07b98c00ff626cdae4019 /tests
parent6412305efe9527a296100a99e9e43088c7e547e6 (diff)
Fix order of destruction in inputContextQueryInput test
The TestInputContext object should be destroyed before the QWebEngineView. Otherwise when the view gets destroyed, Chromium's TextInputManager unregisters itself, which generates an input context event sent to the partially destroyed view, which tries to access an already unregistered Chromium TextInputManager. Change-Id: I54efc5481d343cd5351908623eb643014e78549e Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp b/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp
index 4334498b9..b75fc459d 100644
--- a/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp
+++ b/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp
@@ -1829,11 +1829,14 @@ void tst_QWebEngineView::softwareInputPanel()
void tst_QWebEngineView::inputContextQueryInput()
{
- TestInputContext testContext;
QWebEngineView view;
view.resize(640, 480);
view.show();
+ // testContext will be destroyed before the view, so no events are sent accidentally
+ // when the view is destroyed.
+ TestInputContext testContext;
+
QSignalSpy selectionChangedSpy(&view, SIGNAL(selectionChanged()));
QSignalSpy loadFinishedSpy(&view, SIGNAL(loadFinished(bool)));
view.setHtml("<html><body>"