summaryrefslogtreecommitdiffstats
path: root/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
diff options
context:
space:
mode:
authorSteve Block <steveblock@google.com>2010-02-15 12:23:52 +0000
committerSteve Block <steveblock@google.com>2010-02-16 11:48:32 +0000
commit8a0914b749bbe7da7768e07a7db5c6d4bb09472b (patch)
tree73f9065f370435d6fde32ae129d458a8c77c8dff /WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
parentbf14be70295513b8076f3fa47a268a7e42b2c478 (diff)
downloadexternal_webkit-8a0914b749bbe7da7768e07a7db5c6d4bb09472b.zip
external_webkit-8a0914b749bbe7da7768e07a7db5c6d4bb09472b.tar.gz
external_webkit-8a0914b749bbe7da7768e07a7db5c6d4bb09472b.tar.bz2
Merge webkit.org at r54731 : Initial merge by git
Change-Id: Ia79977b6cf3b0b00c06ef39419989b28e57e4f4a
Diffstat (limited to 'WebKit/qt/tests/qwebpage/tst_qwebpage.cpp')
-rw-r--r--WebKit/qt/tests/qwebpage/tst_qwebpage.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp b/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
index f48fb73..ba7a87e 100644
--- a/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
+++ b/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
@@ -110,6 +110,7 @@ private slots:
void originatingObjectInNetworkRequests();
void testJSPrompt();
+ void showModalDialog();
private:
QWebView* m_view;
@@ -1828,5 +1829,26 @@ void tst_QWebPage::testJSPrompt()
QVERIFY(res);
}
+class TestModalPage : public QWebPage
+{
+ Q_OBJECT
+public:
+ TestModalPage(QObject* parent = 0) : QWebPage(parent) {
+ }
+ virtual QWebPage* createWindow(WebWindowType) {
+ QWebPage* page = new TestModalPage();
+ connect(page, SIGNAL(windowCloseRequested()), page, SLOT(deleteLater()));
+ return page;
+ }
+};
+
+void tst_QWebPage::showModalDialog()
+{
+ TestModalPage page;
+ page.mainFrame()->setHtml(QString("<html></html>"));
+ QString res = page.mainFrame()->evaluateJavaScript("window.showModalDialog('javascript:window.returnValue=dialogArguments; window.close();', 'This is a test');").toString();
+ QCOMPARE(res, QString("This is a test"));
+}
+
QTEST_MAIN(tst_QWebPage)
#include "tst_qwebpage.moc"