diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2010-07-26 14:31:43 (GMT) |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2010-07-26 14:31:43 (GMT) |
commit | 9f657356f897d8bf4c92965a8bc1af82107e2379 (patch) | |
tree | da6f852e71921af3126ed5b0c1e949db11b3857b /src/3rdparty/webkit/WebKit/qt/tests | |
parent | 2268c602cacc7efe5fa54dd026d1c3455ec76c47 (diff) | |
download | Qt-9f657356f897d8bf4c92965a8bc1af82107e2379.zip Qt-9f657356f897d8bf4c92965a8bc1af82107e2379.tar.gz Qt-9f657356f897d8bf4c92965a8bc1af82107e2379.tar.bz2 |
Updated WebKit to 0be9ff9f2b1ec2b748885ac15299bc1c65aca590
Integrated changes:
|| <https://webkit.org/b/42474> || Spatial navigation: do not consider outline for focusable element boundaries ||
|| <https://webkit.org/b/41484> || [Qt] Clamp color stops passed to QGradient to 1.0 ||
|| <https://webkit.org/b/29381> || [Qt] [Regression] QWebView::setHtml() executes script body twice ||
|| <https://webkit.org/b/30879> || Loading HTML with a JS alert() when the DocumentLoader has been set to not defer data load results in ASSERT ||
Diffstat (limited to 'src/3rdparty/webkit/WebKit/qt/tests')
-rw-r--r-- | src/3rdparty/webkit/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp b/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp index 76fdba3..e584f97 100644 --- a/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp +++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp @@ -598,6 +598,7 @@ private slots: void setHtml(); void setHtmlWithResource(); void setHtmlWithBaseURL(); + void setHtmlWithJSAlert(); void ipv6HostEncoding(); void metaData(); #if !defined(Q_WS_MAEMO_5) @@ -2485,6 +2486,33 @@ void tst_QWebFrame::setHtmlWithBaseURL() QCOMPARE(m_view->page()->history()->count(), 0); } +class MyPage : public QWebPage +{ +public: + MyPage() : QWebPage(), alerts(0) {} + int alerts; + +protected: + virtual void javaScriptAlert(QWebFrame*, const QString& msg) + { + alerts++; + QCOMPARE(msg, QString("foo")); + // Should not be enough to trigger deferred loading, since we've upped the HTML + // tokenizer delay in the Qt frameloader. See HTMLTokenizer::continueProcessing() + QTest::qWait(1000); + } +}; + +void tst_QWebFrame::setHtmlWithJSAlert() +{ + QString html("<html><head></head><body><script>alert('foo');</script><p>hello world</p></body></html>"); + MyPage page; + m_view->setPage(&page); + page.mainFrame()->setHtml(html); + QCOMPARE(page.alerts, 1); + QCOMPARE(m_view->page()->mainFrame()->toHtml(), html); +} + class TestNetworkManager : public QNetworkAccessManager { public: |