summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorPeter Varga <pvarga@inf.u-szeged.hu>2016-08-03 12:35:48 +0200
committerPeter Varga <pvarga@inf.u-szeged.hu>2016-08-24 21:24:21 +0000
commit7da3fa4e73a37b0d63a98a4d476447071075935f (patch)
tree80551010604d538efbcfe8b125af096e2fd9106c /tests/auto
parent885a8d4f92b9b308cdbf69a7432a9330a4c46f2d (diff)
Fix tst_QWebEnginePage::popupFormSubmission widget auto test
Change-Id: Ife988a414e0037fe7f3dde3e2e3332119b965b2c Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp19
1 files changed, 12 insertions, 7 deletions
diff --git a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp
index d5f651384..4413ba615 100644
--- a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp
+++ b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp
@@ -612,21 +612,26 @@ void tst_QWebEnginePage::acceptNavigationRequestNavigationType()
void tst_QWebEnginePage::popupFormSubmission()
{
TestPage page;
+ QSignalSpy loadFinishedSpy(&page, SIGNAL(loadFinished(bool)));
QSignalSpy windowCreatedSpy(&page, SIGNAL(windowCreated()));
+
page.settings()->setAttribute(QWebEngineSettings::JavascriptCanOpenWindows, true);
- page.setHtml("<form name=form1 method=get action='' target=myNewWin>"\
- "<input type=hidden name=foo value='bar'>"\
- "</form>");
- page.runJavaScript("window.open('', 'myNewWin', 'width=500,height=300,toolbar=0')");
- evaluateJavaScriptSync(&page, "document.form1.submit();");
+ page.setHtml("<form name='form1' method=get action='' target='myNewWin'>"
+ " <input type='hidden' name='foo' value='bar'>"
+ "</form>");
+ QTRY_COMPARE(loadFinishedSpy.count(), 1);
+ page.runJavaScript("window.open('', 'myNewWin', 'width=500,height=300,toolbar=0');");
+ evaluateJavaScriptSync(&page, "document.form1.submit();");
QTRY_COMPARE(windowCreatedSpy.count(), 1);
+
// The number of popup created should be one.
QVERIFY(page.createdWindows.size() == 1);
- QString url = page.createdWindows.takeFirst()->url().toString();
+ QTRY_VERIFY(!page.createdWindows[0]->url().isEmpty());
+ QString url = page.createdWindows[0]->url().toString();
+
// Check if the form submission was OK.
- QEXPECT_FAIL("", "https://bugs.webkit.org/show_bug.cgi?id=118597", Continue);
QVERIFY(url.contains("?foo=bar"));
}