diff options
| author | Akshay Nair <phenax5@gmail.com> | 2025-05-01 20:43:12 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2025-05-02 16:20:09 +0530 |
| commit | fab5f4d2fd80eb288265c64ba390460ac974ee81 (patch) | |
| tree | aced5984fceced0e621a885c8a38e8ddf88cd203 /spec | |
| parent | 4afe7914a4d4f59703d14f9ba8470ed87831ddcb (diff) | |
| download | null-browser-fab5f4d2fd80eb288265c64ba390460ac974ee81.tar.gz null-browser-fab5f4d2fd80eb288265c64ba390460ac974ee81.zip | |
Make window requests open a tab instead
Diffstat (limited to 'spec')
| -rw-r--r-- | spec/WebViewStackSpec.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
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<WebView *>(); @@ -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>{QUrl("https://a.com"), QUrl("https://new.com")})); + QCOMPARE(webview_stack.current_webview_index(), 1); + QCOMPARE(webview_stack.current_url(), QUrl("https://new.com")); } } }; |
