aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2011-12-13 17:18:45 +0100
committerQt by Nokia <qt-info@nokia.com>2011-12-15 13:42:29 +0100
commitd70cca804e88110eae32f92baff7cee957a6a531 (patch)
treefa2dc18d907095c8bb953e249cfc2dd379b5bd9c /tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp
parent9ae39c98f43a29e3f68a1f34469c9ad2551f813c (diff)
V8: Remove extra V8::Context allocated for expressing strong references
Moved the Referencer code into QV8Engine and re-used the available v8 context there. That also makes things a bit cleaner in the sense that now references from one object to another are guaranteed to be within the same context. Previously some strong references would be across contexts that do not actually share a security token. Change-Id: I717b27a4d96323feb570023d4d84f2b2176d1a84 Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com> Reviewed-by: Chris Adams <christopher.adams@nokia.com>
Diffstat (limited to 'tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp')
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp b/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp
index f3d810ed9d..9bb763cf7c 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp
+++ b/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp
@@ -4129,6 +4129,7 @@ void tst_qdeclarativeecmascript::handleReferenceManagement()
QObject *object = component.create();
QVERIFY(object != 0);
CircularReferenceObject *cro = object->findChild<CircularReferenceObject*>("cro");
+ cro->setEngine(&hrmEngine);
cro->setDtorCount(&dtorCount);
QMetaObject::invokeMethod(object, "createReference");
gc(engine);
@@ -4147,6 +4148,7 @@ void tst_qdeclarativeecmascript::handleReferenceManagement()
QObject *object = component.create();
QVERIFY(object != 0);
CircularReferenceObject *cro = object->findChild<CircularReferenceObject*>("cro");
+ cro->setEngine(&hrmEngine);
cro->setDtorCount(&dtorCount);
QMetaObject::invokeMethod(object, "circularReference");
gc(engine);
@@ -4166,6 +4168,7 @@ void tst_qdeclarativeecmascript::handleReferenceManagement()
QVERIFY(object != 0);
CircularReferenceHandle *crh = object->findChild<CircularReferenceHandle*>("crh");
QVERIFY(crh != 0);
+ crh->setEngine(&hrmEngine);
crh->setDtorCount(&dtorCount);
QMetaObject::invokeMethod(object, "createReference");
CircularReferenceHandle *first = object->property("first").value<CircularReferenceHandle*>();
@@ -4193,6 +4196,7 @@ void tst_qdeclarativeecmascript::handleReferenceManagement()
QVERIFY(object != 0);
CircularReferenceHandle *crh = object->findChild<CircularReferenceHandle*>("crh");
QVERIFY(crh != 0);
+ crh->setEngine(&hrmEngine);
crh->setDtorCount(&dtorCount);
QMetaObject::invokeMethod(object, "circularReference");
CircularReferenceHandle *first = object->property("first").value<CircularReferenceHandle*>();
@@ -4229,6 +4233,8 @@ void tst_qdeclarativeecmascript::handleReferenceManagement()
CircularReferenceHandle *crh2 = object2->findChild<CircularReferenceHandle*>("crh");
QVERIFY(crh1 != 0);
QVERIFY(crh2 != 0);
+ crh1->setEngine(&hrmEngine1);
+ crh2->setEngine(&hrmEngine2);
crh1->setDtorCount(&dtorCount);
crh2->setDtorCount(&dtorCount);
QMetaObject::invokeMethod(object1, "createReference");
@@ -4271,6 +4277,8 @@ void tst_qdeclarativeecmascript::handleReferenceManagement()
CircularReferenceHandle *crh2 = object2->findChild<CircularReferenceHandle*>("crh");
QVERIFY(crh1 != 0);
QVERIFY(crh2 != 0);
+ crh1->setEngine(&hrmEngine1);
+ crh2->setEngine(&hrmEngine2);
crh1->setDtorCount(&dtorCount);
crh2->setDtorCount(&dtorCount);
QMetaObject::invokeMethod(object1, "createReference");
@@ -4322,6 +4330,8 @@ void tst_qdeclarativeecmascript::handleReferenceManagement()
CircularReferenceHandle *crh2 = object2->findChild<CircularReferenceHandle*>("crh");
QVERIFY(crh1 != 0);
QVERIFY(crh2 != 0);
+ crh1->setEngine(hrmEngine1);
+ crh2->setEngine(hrmEngine2);
crh1->setDtorCount(&dtorCount);
crh2->setDtorCount(&dtorCount);
QMetaObject::invokeMethod(object1, "createReference");