summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorSzabolcs David <davidsz@inf.u-szeged.hu>2014-09-25 02:31:09 -0700
committerSzabolcs David <davidsz@inf.u-szeged.hu>2014-09-26 12:46:31 +0200
commit833e8261264b5eddac030e477ba18a2d62a6bd97 (patch)
tree56bbf2df2a53fab9ac04d5f56d4886416426571e /tests
parent411e5e9e6d7b68dfae4a93ef90c042d92b7322c1 (diff)
Unskip QWebEngineSettings::JavascriptCanOpenWindows related tests
Window.showModalDialog() is not supported since Chromium 37, so we can remove the showModalDialog test case. If the view is not visible, the width and the height of the requested geometry is always 0 in tst_QWebEnginePage::openWindowDefaultSize. Change-Id: I420828815bc9528070ca58a9e42dea44517aeafc Reviewed-by: Andras Becsi <andras.becsi@digia.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp40
1 files changed, 5 insertions, 35 deletions
diff --git a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp
index 70fbba12..d098d8e7 100644
--- a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp
+++ b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp
@@ -39,6 +39,7 @@
#include <qpa/qplatforminputcontext.h>
#include <qwebenginehistory.h>
#include <qwebenginepage.h>
+#include <qwebenginesettings.h>
#include <qwebengineview.h>
#include <qimagewriter.h>
@@ -171,7 +172,6 @@ private Q_SLOTS:
void networkReplyParentDidntChange();
void destroyQNAMBeforeAbortDoesntCrash();
void testJSPrompt();
- void showModalDialog();
void testStopScheduledPageRefresh();
void findText();
void findTextResult();
@@ -471,9 +471,6 @@ private Q_SLOTS:
void tst_QWebEnginePage::popupFormSubmission()
{
-#if !defined(QWEBENGINEPAGE_SETTINGS)
- QSKIP("QWEBENGINEPAGE_SETTINGS");
-#else
TestPage page;
page.settings()->setAttribute(QWebEngineSettings::JavascriptCanOpenWindows, true);
page.setHtml("<form name=form1 method=get action='' target=myNewWin>"\
@@ -490,7 +487,6 @@ void tst_QWebEnginePage::popupFormSubmission()
// Check if the form submission was OK.
QEXPECT_FAIL("", "https://bugs.webkit.org/show_bug.cgi?id=118597", Continue);
QVERIFY(url.contains("?foo=bar"));
-#endif
}
void tst_QWebEnginePage::acceptNavigationRequestWithNewWindow()
@@ -3148,32 +3144,6 @@ void tst_QWebEnginePage::testJSPrompt()
QVERIFY(res);
}
-class TestModalPage : public QWebEnginePage
-{
- Q_OBJECT
-public:
- TestModalPage(QObject* parent = 0) : QWebEnginePage(parent) {
- }
- virtual QWebEnginePage* createWindow(WebWindowType) {
- QWebEnginePage* page = new TestModalPage();
- connect(page, SIGNAL(windowCloseRequested()), page, SLOT(deleteLater()));
- return page;
- }
-};
-
-void tst_QWebEnginePage::showModalDialog()
-{
-#if !defined(QWEBENGINESETTINGS)
- QSKIP("QWEBENGINESETTINGS");
-#else
- TestModalPage page;
- page.settings()->setAttribute(QWebEngineSettings::JavascriptCanOpenWindows, true);
- page.setHtml(QString("<html></html>"));
- QString res = evaluateJavaScriptSync(&page, "window.showModalDialog('javascript:window.returnValue=dialogArguments; window.close();', 'This is a test');").toString();
- QCOMPARE(res, QString("This is a test"));
-#endif
-}
-
void tst_QWebEnginePage::testStopScheduledPageRefresh()
{
#if !defined(QWEBENGINEPAGE_SETNETWORKACCESSMANAGER)
@@ -3680,10 +3650,11 @@ void tst_QWebEnginePage::getUserMediaRequest()
void tst_QWebEnginePage::openWindowDefaultSize()
{
-#if !defined(QWEBENGINEPAGE_SETTINGS)
- QSKIP("QWEBENGINEPAGE_SETTINGS");
-#else
TestPage page;
+ QWebEngineView view;
+ page.setView(&view);
+ view.show();
+
page.settings()->setAttribute(QWebEngineSettings::JavascriptCanOpenWindows, true);
// Open a default window.
page.runJavaScript("window.open()");
@@ -3703,7 +3674,6 @@ void tst_QWebEnginePage::openWindowDefaultSize()
// Check minimum size has been requested.
QVERIFY(requestedGeometry.width() == 100);
QVERIFY(requestedGeometry.height() == 100);
-#endif
}
void tst_QWebEnginePage::cssMediaTypeGlobalSetting()