diff options
author | Konstantin Tokarev <annulen@yandex.ru> | 2016-08-25 19:20:41 +0300 |
---|---|---|
committer | Konstantin Tokarev <annulen@yandex.ru> | 2017-02-02 12:30:55 +0000 |
commit | 6882a04fb36642862b11efe514251d32070c3d65 (patch) | |
tree | b7959826000b061fd5ccc7512035c7478742f7b0 /Source/WebKit/qt/tests/qobjectbridge | |
parent | ab6df191029eeeb0b0f16f127d553265659f739e (diff) |
Imported QtWebKit TP3 (git b57bc6801f1876c3220d5a4bfea33d620d477443)
Change-Id: I3b1d8a2808782c9f34d50240000e20cb38d3680f
Reviewed-by: Konstantin Tokarev <annulen@yandex.ru>
Diffstat (limited to 'Source/WebKit/qt/tests/qobjectbridge')
-rw-r--r-- | Source/WebKit/qt/tests/qobjectbridge/qobjectbridge.pro | 3 | ||||
-rw-r--r-- | Source/WebKit/qt/tests/qobjectbridge/tst_qobjectbridge.cpp | 13 |
2 files changed, 9 insertions, 7 deletions
diff --git a/Source/WebKit/qt/tests/qobjectbridge/qobjectbridge.pro b/Source/WebKit/qt/tests/qobjectbridge/qobjectbridge.pro deleted file mode 100644 index f434ccbc1..000000000 --- a/Source/WebKit/qt/tests/qobjectbridge/qobjectbridge.pro +++ /dev/null @@ -1,3 +0,0 @@ -include(../tests.pri) -exists($${TARGET}.qrc):RESOURCES += $${TARGET}.qrc - diff --git a/Source/WebKit/qt/tests/qobjectbridge/tst_qobjectbridge.cpp b/Source/WebKit/qt/tests/qobjectbridge/tst_qobjectbridge.cpp index 52e6422b1..2eacc70b0 100644 --- a/Source/WebKit/qt/tests/qobjectbridge/tst_qobjectbridge.cpp +++ b/Source/WebKit/qt/tests/qobjectbridge/tst_qobjectbridge.cpp @@ -1567,31 +1567,34 @@ void tst_QObjectBridge::connectAndDisconnect() QCOMPARE(evalJS("myObject.mySignalWithIntArg.disconnect(myObject, 'myOverloadedSlot(int)')"), sUndefined); // erroneous input +#define NOT_A_FUNCTION(f, expr) \ + "TypeError: " f " is not a function. (In '" expr "', '" f "' is undefined)" + { // ### QtScript adds .connect to all functions, WebKit does only to signals/slots QString type; QString ret = evalJS("(function() { }).connect()", type); QCOMPARE(type, sError); - QCOMPARE(ret, QLatin1String("TypeError: undefined is not a function (evaluating '(function() { }).connect()')")); + QCOMPARE(ret, QLatin1String(NOT_A_FUNCTION("(function() { }).connect", "(function() { }).connect()"))); } { QString type; QString ret = evalJS("var o = { }; o.connect = Function.prototype.connect; o.connect()", type); QCOMPARE(type, sError); - QCOMPARE(ret, QLatin1String("TypeError: undefined is not a function (evaluating 'o.connect()')")); + QCOMPARE(ret, QLatin1String(NOT_A_FUNCTION("o.connect", "o.connect()"))); } { QString type; QString ret = evalJS("(function() { }).connect(123)", type); QCOMPARE(type, sError); - QCOMPARE(ret, QLatin1String("TypeError: undefined is not a function (evaluating '(function() { }).connect(123)')")); + QCOMPARE(ret, QLatin1String(NOT_A_FUNCTION("(function() { }).connect", "(function() { }).connect(123)"))); } { QString type; QString ret = evalJS("var o = { }; o.connect = Function.prototype.connect; o.connect(123)", type); QCOMPARE(type, sError); - QCOMPARE(ret, QLatin1String("TypeError: undefined is not a function (evaluating 'o.connect(123)')")); + QCOMPARE(ret, QLatin1String(NOT_A_FUNCTION("o.connect", "o.connect(123)"))); } { @@ -2221,6 +2224,7 @@ protected: void tst_QObjectBridge::scriptablePlugin() { +//#if !PLUGIN_VIEW_IS_BROKEN QWebView view; TestWebPage* page = new TestWebPage; view.setPage(page); @@ -2232,6 +2236,7 @@ void tst_QObjectBridge::scriptablePlugin() QVariant result = page->mainFrame()->evaluateJavaScript("document.querySelector(\"object\").slotWithReturnValue()"); QCOMPARE(result.toString(), QLatin1String("42")); +//#endif } QTEST_MAIN(tst_QObjectBridge) |