Changeset 56686 in webkit for trunk/JavaScriptCore/qt/tests


Ignore:
Timestamp:
Mar 28, 2010, 3:03:50 AM (15 years ago)
Author:
[email protected]
Message:

2010-03-28 Jedrzej Nowacki <[email protected]>

Reviewed by Simon Hausmann.

QScriptEngine API was enriched by globalObject() method
which give an access to the global object.

[Qt] QScriptEngine doesn't give an access to global object
https://bugs.webkit.org/show_bug.cgi?id=36603

  • qt/api/qscriptengine.cpp: (QScriptEngine::globalObject):
  • qt/api/qscriptengine.h:
  • qt/api/qscriptengine_p.cpp: (QScriptEnginePrivate::globalObject):
  • qt/api/qscriptengine_p.h:
  • qt/tests/qscriptengine/tst_qscriptengine.cpp: (tst_QScriptEngine::globalObject):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/qt/tests/qscriptengine/tst_qscriptengine.cpp

    r56333 r56686  
    3636
    3737private slots:
     38    void globalObject();
    3839    void evaluate();
    3940    void collectGarbage();
     
    5152    QVERIFY2(engine.evaluate("1+1").isValid(), "the expression should be evaluated and an valid result should be returned");
    5253    QVERIFY2(engine.evaluate("ping").isValid(), "Script throwing an unhandled exception should return an exception value");
     54}
     55
     56void tst_QScriptEngine::globalObject()
     57{
     58    QScriptEngine engine;
     59    QScriptValue global = engine.globalObject();
     60    QScriptValue self = engine.evaluate("this");
     61    QVERIFY(global.isObject());
     62    QVERIFY(engine.globalObject().equals(engine.evaluate("this")));
     63    QEXPECT_FAIL("", "strictlyEquals is broken - bug 36600 in bugs.webkit.org", Continue);
     64    QVERIFY(engine.globalObject().strictlyEquals(self));
    5365}
    5466
Note: See TracChangeset for help on using the changeset viewer.