summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/webkit/WebKit/qt/tests
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2009-09-18 09:25:50 (GMT)
committerSimon Hausmann <simon.hausmann@nokia.com>2009-09-18 09:26:05 (GMT)
commita2c02edcf8df4d0967a851db71b2e4e8420db9b9 (patch)
tree09a1dabe20d77782ee679eae6a7e0f225030ca44 /src/3rdparty/webkit/WebKit/qt/tests
parent6009e98900a605209de38bb73146683fbe606e44 (diff)
downloadQt-a2c02edcf8df4d0967a851db71b2e4e8420db9b9.zip
Qt-a2c02edcf8df4d0967a851db71b2e4e8420db9b9.tar.gz
Qt-a2c02edcf8df4d0967a851db71b2e4e8420db9b9.tar.bz2
Updated WebKit from /home/shausman/src/webkit/trunk to origin/qtwebkit-4.6-staging ( f572f72dce91be9a4525941c87d1b0a8c383ba39 )
Changes in WebKit/qt since the last update: ++ b/WebKit/qt/ChangeLog 2009-09-18 Simon Hausmann <simon.hausmann@nokia.com> Reviewed by Ariya Hidayat. Fixed a bunch of documentation warnings. * Api/qwebgraphicsitem.cpp: * Api/qwebplugindatabase.cpp: * Api/qwebpluginfactory.cpp: * Api/qwebsecurityorigin.cpp: 2009-09-18 Warwick Allison <warwick.allison@nokia.com> Reviewed by Simon Hausmann. Added a test that console output works. * tests/qwebpage/tst_qwebpage.cpp: (ConsolePage::ConsolePage): (ConsolePage::javaScriptConsoleMessage): (tst_QWebPage::consoleOutput):
Diffstat (limited to 'src/3rdparty/webkit/WebKit/qt/tests')
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp b/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
index 121d7cb..c575137 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
@@ -114,6 +114,8 @@ private slots:
void testOptionalJSObjects();
void testEnablePersistentStorage();
+ void consoleOutput();
+
private:
@@ -241,6 +243,31 @@ void tst_QWebPage::loadFinished()
QCOMPARE(spyLoadFinished.count(), 1);
}
+class ConsolePage : public QWebPage
+{
+public:
+ ConsolePage(QObject* parent = 0) : QWebPage(parent) {}
+
+ virtual void javaScriptConsoleMessage(const QString& message, int lineNumber, const QString& sourceID)
+ {
+ messages.append(message);
+ lineNumbers.append(lineNumber);
+ sourceIDs.append(sourceID);
+ }
+
+ QStringList messages;
+ QList<int> lineNumbers;
+ QStringList sourceIDs;
+};
+
+void tst_QWebPage::consoleOutput()
+{
+ ConsolePage page;
+ page.mainFrame()->evaluateJavaScript("this is not valid JavaScript");
+ QCOMPARE(page.messages.count(), 1);
+ QCOMPARE(page.lineNumbers.at(0), 1);
+}
+
class TestPage : public QWebPage
{
public: