From fab5f4d2fd80eb288265c64ba390460ac974ee81 Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Thu, 1 May 2025 20:43:12 +0530 Subject: Make window requests open a tab instead --- spec/WebViewStackSpec.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'spec') diff --git a/spec/WebViewStackSpec.cpp b/spec/WebViewStackSpec.cpp index a63eca6..8391dbe 100644 --- a/spec/WebViewStackSpec.cpp +++ b/spec/WebViewStackSpec.cpp @@ -241,7 +241,6 @@ private slots: it("requests a new window") { Configuration configuration; WebViewStack webview_stack(&configuration); - QSignalSpy new_window_requested_spy(&webview_stack, &WebViewStack::new_window_requested); webview_stack.open_url(QUrl("https://a.com")); QCOMPARE(webview_stack.count(), 1); auto *webview = webview_stack.findChild(); @@ -249,11 +248,12 @@ private slots: FakeNewWindowRequest window_request(FakeNewWindowRequest::DestinationType::InNewWindow, QRect(0, 0, 0, 0), QUrl("https://new.com"), true); emit webview->page()->newWindowRequested(window_request); - new_window_requested_spy.wait(100); - QCOMPARE(new_window_requested_spy.count(), 1); - QCOMPARE(new_window_requested_spy.takeFirst().at(0), QUrl("https://new.com")); - QCOMPARE(webview_stack.count(), 1); + QCOMPARE(webview_stack.count(), 2); + QCOMPARE(webview_stack.urls(), + (std::vector{QUrl("https://a.com"), QUrl("https://new.com")})); + QCOMPARE(webview_stack.current_webview_index(), 1); + QCOMPARE(webview_stack.current_url(), QUrl("https://new.com")); } } }; -- cgit v1.3.1