REGRESSION: Qt JavaScript bridge signal connection fails

https://bugs.webkit.org/show_bug.cgi?id=66097

Patch by Andrew Wason <rectalogic@rectalogic.com> on 2011-08-11
Reviewed by Gavin Barraclough.

Source/WebCore:

Tests in WebKit/qt/tests/qwebframe

Call toThisObject() on exec->lexicalGlobalObject() so the correct
object is passed to the JS signal handler.

* bridge/qt/qt_runtime.cpp:
(JSC::Bindings::QtRuntimeConnectionMethod::call):

Source/WebKit/qt:

Unmark tests as expected failures, they pass now.

* tests/qwebframe/tst_qwebframe.cpp:
(tst_QWebFrame::connectAndDisconnect):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@92907 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 39b01dab
2011-08-11 Andrew Wason <rectalogic@rectalogic.com>
REGRESSION: Qt JavaScript bridge signal connection fails
https://bugs.webkit.org/show_bug.cgi?id=66097
Reviewed by Gavin Barraclough.
Tests in WebKit/qt/tests/qwebframe
Call toThisObject() on exec->lexicalGlobalObject() so the correct
object is passed to the JS signal handler.
* bridge/qt/qt_runtime.cpp:
(JSC::Bindings::QtRuntimeConnectionMethod::call):
2011-08-11 Nico Weber <thakis@chromium.org>
Remove incorrect comment about m_wheelEventHandlerCount
......@@ -1584,7 +1584,7 @@ EncodedJSValue QtRuntimeConnectionMethod::call(ExecState* exec)
if (sender) {
JSObject* thisObject = exec->lexicalGlobalObject();
JSObject* thisObject = exec->lexicalGlobalObject()->toThisObject(exec);
JSObject* funcObject = 0;
// QtScript checks signalness first, arguments second
......
2011-08-11 Andrew Wason <rectalogic@rectalogic.com>
REGRESSION: Qt JavaScript bridge signal connection fails
https://bugs.webkit.org/show_bug.cgi?id=66097
Reviewed by Gavin Barraclough.
Unmark tests as expected failures, they pass now.
* tests/qwebframe/tst_qwebframe.cpp:
(tst_QWebFrame::connectAndDisconnect):
2011-08-09 Sheriff Bot <webkit.review.bot@gmail.com>
Unreviewed, rolling out r92683.
......
......@@ -1454,7 +1454,6 @@ void tst_QWebFrame::connectAndDisconnect()
QCOMPARE(evalJS("gotSignal"), sTrue);
QCOMPARE(evalJS("signalArgs.length == 0"), sTrue);
QCOMPARE(evalJS("signalSender"),evalJS("myObject"));
QEXPECT_FAIL("", "https://bugs.webkit.org/show_bug.cgi?id=65170", Continue);
QCOMPARE(evalJS("slotThisObject == window"), sTrue);
evalJS("gotSignal = false");
......@@ -1560,7 +1559,6 @@ void tst_QWebFrame::connectAndDisconnect()
// one argument
QCOMPARE(evalJS("myObject.mySignalWithIntArg.connect(myObject.mySlotWithIntArg)"), sUndefined);
m_myObject->resetQtFunctionInvoked();
QEXPECT_FAIL("", "https://bugs.webkit.org/show_bug.cgi?id=65170", Continue);
QCOMPARE(evalJS("myObject.mySignalWithIntArg(123)"), sUndefined);
QCOMPARE(m_myObject->qtFunctionInvoked(), 21);
QCOMPARE(m_myObject->qtFunctionActuals().size(), 1);
......@@ -1569,7 +1567,6 @@ void tst_QWebFrame::connectAndDisconnect()
QCOMPARE(evalJS("myObject.mySignalWithIntArg.connect(myObject.mySlotWithDoubleArg)"), sUndefined);
m_myObject->resetQtFunctionInvoked();
QEXPECT_FAIL("", "https://bugs.webkit.org/show_bug.cgi?id=65170", Continue);
QCOMPARE(evalJS("myObject.mySignalWithIntArg(123)"), sUndefined);
QCOMPARE(m_myObject->qtFunctionInvoked(), 22);
QCOMPARE(m_myObject->qtFunctionActuals().size(), 1);
......@@ -1578,7 +1575,6 @@ void tst_QWebFrame::connectAndDisconnect()
QCOMPARE(evalJS("myObject.mySignalWithIntArg.connect(myObject.mySlotWithStringArg)"), sUndefined);
m_myObject->resetQtFunctionInvoked();
QEXPECT_FAIL("", "https://bugs.webkit.org/show_bug.cgi?id=65170", Continue);
QCOMPARE(evalJS("myObject.mySignalWithIntArg(123)"), sUndefined);
QCOMPARE(m_myObject->qtFunctionInvoked(), 23);
QCOMPARE(m_myObject->qtFunctionActuals().size(), 1);
......@@ -1588,7 +1584,6 @@ void tst_QWebFrame::connectAndDisconnect()
// connecting to overloaded slot
QCOMPARE(evalJS("myObject.mySignalWithIntArg.connect(myObject.myOverloadedSlot)"), sUndefined);
m_myObject->resetQtFunctionInvoked();
QEXPECT_FAIL("", "https://bugs.webkit.org/show_bug.cgi?id=65170", Continue);
QCOMPARE(evalJS("myObject.mySignalWithIntArg(123)"), sUndefined);
QCOMPARE(m_myObject->qtFunctionInvoked(), 26); // double overload
QCOMPARE(m_myObject->qtFunctionActuals().size(), 1);
......@@ -1597,7 +1592,6 @@ void tst_QWebFrame::connectAndDisconnect()
QCOMPARE(evalJS("myObject.mySignalWithIntArg.connect(myObject['myOverloadedSlot(int)'])"), sUndefined);
m_myObject->resetQtFunctionInvoked();
QEXPECT_FAIL("", "https://bugs.webkit.org/show_bug.cgi?id=65170", Continue);
QCOMPARE(evalJS("myObject.mySignalWithIntArg(456)"), sUndefined);
QCOMPARE(m_myObject->qtFunctionInvoked(), 28); // int overload
QCOMPARE(m_myObject->qtFunctionActuals().size(), 1);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment