From 5af96e2c7b73ebc627c6894727826a7576d31758 Mon Sep 17 00:00:00 2001 From: Leon Clarke Date: Thu, 3 Jun 2010 14:33:32 +0100 Subject: Merge webkit.org at r60469 : Initial merge by git. Change-Id: I66a0047aa2af802f66bb0c7f2a8b02247a596234 --- WebKit/qt/tests/qwebpage/tst_qwebpage.cpp | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) (limited to 'WebKit/qt/tests/qwebpage/tst_qwebpage.cpp') diff --git a/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp b/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp index ceb8aff..630ccce 100644 --- a/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp +++ b/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp @@ -122,7 +122,8 @@ private slots: void originatingObjectInNetworkRequests(); void testJSPrompt(); void showModalDialog(); - + void testStopScheduledPageRefresh(); + private: QWebView* m_view; QWebPage* m_page; @@ -2090,5 +2091,30 @@ void tst_QWebPage::showModalDialog() QCOMPARE(res, QString("This is a test")); } +void tst_QWebPage::testStopScheduledPageRefresh() +{ + // Without QWebPage::StopScheduledPageRefresh + QWebPage page1; + page1.setNetworkAccessManager(new TestNetworkManager(&page1)); + page1.mainFrame()->setHtml("" + "" + "

Page redirects immediately...

" + ""); + QVERIFY(::waitForSignal(&page1, SIGNAL(loadFinished(bool)))); + QTest::qWait(500); + QCOMPARE(page1.mainFrame()->url().toString(), QString("http://qt.nokia.com/favicon.ico")); + + // With QWebPage::StopScheduledPageRefresh + QWebPage page2; + page2.setNetworkAccessManager(new TestNetworkManager(&page2)); + page2.mainFrame()->setHtml("" + "" + "

Page redirect test with 1 sec timeout...

" + ""); + page2.triggerAction(QWebPage::StopScheduledPageRefresh); + QTest::qWait(1500); + QCOMPARE(page2.mainFrame()->url().toString(), QString("about:blank")); +} + QTEST_MAIN(tst_QWebPage) #include "tst_qwebpage.moc" -- cgit v1.1