diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2019-05-03 10:45:54 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2019-05-03 10:01:39 +0000 |
commit | fc077552673e25c580592047369acbe47f4be46d (patch) | |
tree | e6da32cf75d1f0f2b76af6f2f60f061b2678a861 /tests | |
parent | 5a4656b9c731418f5568e57060b96b81333ac98f (diff) |
Do not crash on QWebEnginePagePrivate::releaseProfile()
Deregistering the widget or deleting the view should be able to handle
a now missing d_ptr in the old page.
Change-Id: Ic843f7bde12776b6aad4fad865ccf14a25695154
Fixes: QTBUG-75547
Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp b/tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp index e84aacb27..2a4e2d533 100644 --- a/tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp +++ b/tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp @@ -60,6 +60,7 @@ private Q_SLOTS: void downloadItem(); void changePersistentPath(); void initiator(); + void badDeleteOrder(); void qtbug_72299(); // this should be the last test }; @@ -589,6 +590,24 @@ void tst_QWebEngineProfile::initiator() QCOMPARE(handler.initiator, QUrl()); } +void tst_QWebEngineProfile::badDeleteOrder() +{ + QWebEngineProfile *profile = new QWebEngineProfile(); + QWebEngineView *view = new QWebEngineView(); + view->resize(640, 480); + view->show(); + QVERIFY(QTest::qWaitForWindowExposed(view)); + QWebEnginePage *page = new QWebEnginePage(profile, view); + view->setPage(page); + + QSignalSpy spyLoadFinished(page, SIGNAL(loadFinished(bool))); + page->setHtml(QStringLiteral("<html><body><h1>Badly handled page!</h1></body></html>")); + QTRY_COMPARE(spyLoadFinished.count(), 1); + + delete profile; + delete view; +} + void tst_QWebEngineProfile::qtbug_72299() { QWebEngineView view; |