RESOLVED FIXED Bug 34755
[Qt] Unit test for window.showModalDialog
https://bugs.webkit.org/show_bug.cgi?id=34755
Summary [Qt] Unit test for window.showModalDialog
Yael
Reported 2010-02-09 07:59:53 PST
After r54550, QtWebKit supports window.runModalDialog, but it does not have a unit test yet.
Attachments
Patch v1 (1.89 KB, patch)
2010-02-09 12:02 PST, Yael
no flags
Yael
Comment 1 2010-02-09 12:02:29 PST
Created attachment 48434 [details] Patch v1 Add unit test for window.showModalDialog
Adam Barth
Comment 2 2010-02-09 12:05:44 PST
Comment on attachment 48434 [details] Patch v1 LGTM
Yael
Comment 3 2010-02-09 18:30:14 PST
Yael
Comment 4 2010-02-09 18:30:54 PST
Comment on attachment 48434 [details] Patch v1 > Index: WebKit/qt/tests/qwebpage/tst_qwebpage.cpp > =================================================================== > --- WebKit/qt/tests/qwebpage/tst_qwebpage.cpp (revision 54545) > +++ WebKit/qt/tests/qwebpage/tst_qwebpage.cpp (working copy) > @@ -110,6 +110,7 @@ > > void originatingObjectInNetworkRequests(); > void testJSPrompt(); > + void showModalDialog(); > > private: > QWebView* m_view; > @@ -1828,5 +1829,26 @@ > 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" > Index: WebKit/qt/ChangeLog > =================================================================== > --- WebKit/qt/ChangeLog (revision 54561) > +++ WebKit/qt/ChangeLog (working copy) > @@ -1,5 +1,17 @@ > 2010-02-09 Yael Aharon <yael.aharon@nokia.com> > > + Reviewed by NOBODY (OOPS!). > + > + [Qt] Unit test for window.runModalDialog > + https://bugs.webkit.org/show_bug.cgi?id=34755 > + > + * tests/qwebpage/tst_qwebpage.cpp: > + (TestModalPage::TestModalPage): > + (TestModalPage::createWindow): > + (tst_QWebPage::showModalDialog): > + > +2010-02-09 Yael Aharon <yael.aharon@nokia.com> > + > Reviewed by Kenneth Rohde Christiansen. > > [Qt] Webkit in Qt does not have window.showModalDialog Clearing flags.
Note You need to log in before you can comment on or make changes to this bug.