diff options
author | Jüri Valdmann <juri.valdmann@qt.io> | 2020-04-23 12:55:58 +0200 |
---|---|---|
committer | Jüri Valdmann <juri.valdmann@qt.io> | 2020-04-26 18:10:39 +0200 |
commit | 6c7148af789af401b39f0283f8060624432c5b56 (patch) | |
tree | 81988d97a69741602f80ae7e31f0982c0f1a3f0e /tests | |
parent | d4004e30ba9a09f75a810d4734dd6be18616b5e5 (diff) |
Restore behavior of OpenURLFromTab if createWindow returns this
Instead of using QSharedPointer's reference count to communicate
adoption/non-adoption, change adoptNewWindow to return a adapter pointer, with
null meaning non-adoption. Then change QWebEnginePage's implementation to reuse
already existing adapters if possible, restoring previous behavior of
OpenURLFromTab when createWindow returns this.
Task-number: QTBUG-80596
Change-Id: I8ee7c31e4294aabd3207c504cba67d6171c66cb0
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp index a638b7183..d2d8ade91 100644 --- a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp +++ b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp @@ -3520,8 +3520,8 @@ void tst_QWebEnginePage::openLinkInNewPage() QTRY_COMPARE(page1.spy.count(), 1); QVERIFY(page1.spy.takeFirst().value(0).toBool()); QCOMPARE(page2.spy.count(), 0); - if (decision == Decision::ReturnSelf) - // History was discarded + if (decision == Decision::ReturnSelf && cause == Cause::TargetBlank) + // History was discarded due to AddNewContents QCOMPARE(page1.history()->count(), 1); else QCOMPARE(page1.history()->count(), 2); |