summaryrefslogtreecommitdiffstats
path: root/tests/auto/qscriptvalue
Commit message (Collapse)AuthorAgeFilesLines
* Update copyright year in Digia's license headersSergio Ahumada2013-01-132-2/+2
| | | | | | Change-Id: I52bf8ef0447b701b4ebf7d7d240013a72adb9425 Reviewed-by: Akseli Salovaara <akseli.salovaara@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-292-48/+48
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: I280c0a575987d1770e354b4948f1d4d767d711ea Reviewed-by: Simo Fält <simo.falt@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Update contact information in license headers.Sergio Ahumada2012-08-012-4/+4
| | | | | | | | | | | | | - Replace Nokia contact email address with Qt Project website. - Remove "All rights reserved" line from license headers. As in the past, to avoid rewriting various autotests that contain line-number information, an extra blank line has been inserted at the end of the license text to ensure that this commit does not change the total number of lines in the license header. Change-Id: Ie7ba62011752fcb149b99b26317c54f2a0cfa931 Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* Update year in Nokia copyright messages.Jason McDonald2012-01-112-2/+2
| | | | | | | | | Simple search and replace. This commit doesn't touch 3rd-party files, nor translations (where the change is not so simple and will be handled in a separate commit). Change-Id: I4e48513b8078a44a8cd272326685b25338890148 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Update licenseheader text in source files for qt4.8Jyri Tahtela2011-05-132-34/+34
| | | | | | | Updated version of LGPL and FDL licenseheaders. Apply release phase licenseheaders for all source files. Reviewed-by: Trust Me
* Don't allow non-Object values to be set as prototypeKent Hansen2011-03-021-4/+1
| | | | | | | | | It should only be possible to set an object or null as prototype. This is consistent with both JSC and V8. Additionally, it keeps JSC from asserting in debug mode. Task-number: QTBUG-15154 Reviewed-by: Jedrzej Nowacki
* Link expected failures to tasksKent Hansen2011-02-231-5/+5
| | | | | | | These failures are all due to regressions when switching to the JavaScriptCore-based back-end (Qt 4.6). The failure messages now contain the IDs of the corresponding tasks that have more information.
* Merge remote branch 'origin/4.7' into qt-master-from-4.7Olivier Goffart2011-01-172-2/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/webkit/imageanalyzer/imageanalyzer.h examples/webkit/imageanalyzer/mainwindow.h mkspecs/unsupported/qws/linux-x86-openkode-g++/qplatformdefs.h src/corelib/io/qfsfileengine_iterator_unix.cpp src/corelib/io/qfsfileengine_iterator_win.cpp src/corelib/kernel/qcoreapplication.cpp src/network/access/qnetworkaccessdatabackend.cpp src/plugins/bearer/connman/qconnmanservice_linux.cpp src/plugins/platforms/openvglite/qwindowsurface_vglite.h src/s60installs/bwins/QtCoreu.def src/s60installs/eabi/QtCoreu.def src/s60installs/s60installs.pro tools/assistant/tools/assistant/helpviewer_qwv.h tools/qdoc3/test/qt-html-templates.qdocconf
| * Update copyright year to 2011.Jason McDonald2011-01-1011-13/+13
| | | | | | | | Reviewed-by: Trust Me
* | QScript tests, sync the tests with the v8 branchOlivier Goffart2010-12-102-2/+63
| |
* | QtScript variant conversion: Convert numbers to (u)int if applicable ↵Thomas Senyk2010-11-251-0/+4
| | | | | | | | (reviewed by khansen)
* | Fix QScriptValue::construct.Jedrzej Nowacki2010-11-222-0/+13
| | | | | | | | | | | | | | It is not allowed to mix values that were created in different QScriptEngine instances. Reviewed-by: Kent Hansen
* | Split tst_QScriptValue::construct tests into smaller chunks.Jedrzej Nowacki2010-11-222-107/+147
| | | | | | | | Reviewed-by: Kent Hansen
* | Split newQObject tests into smaller chunks.Jedrzej Nowacki2010-11-182-56/+36
| | | | | | | | Reviewed-by: Kent Hansen
* | Merge remote branch 'origin/4.7' into qt-master-from-4.7Olivier Goffart2010-11-122-0/+16
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: configure doc/src/snippets/code/doc_src_qmake-manual.qdoc mkspecs/features/symbian/application_icon.prf mkspecs/features/symbian/default_post.prf mkspecs/features/symbian/symbian_building.prf qmake/generators/symbian/initprojectdeploy_symbian.cpp src/multimedia/audio/audio.pri src/network/access/qnetworkaccessmanager.cpp src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp src/opengl/qgl_p.h src/plugins/bearer/corewlan/qcorewlanengine.mm src/plugins/phonon/mmf/mmf.pro tests/auto/qscriptvalue/tst_qscriptvalue.cpp tests/auto/qscriptvalue/tst_qscriptvalue.h tools/qdoc3/doc/qdoc-manual.qdocconf
| * Fix GC-related crash in QScriptValue::setData()Kent Hansen2010-11-092-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Yet another missing API shim. When converting the QScriptValue to JSC, a JSCell may be allocated, which can cause the GC to trigger. If an identifier (JSC::Identifier) is then garbage collected, the destructor will try to remove itself from the currentIdentifierTable(). Because the API shim was missing, the identifier table was 0. It's difficult to create a bulletproof test for this case, but the attached test is a best effort (it crashes on my machine without the fix). Task-number: QTBUG-15144 Reviewed-by: Jedrzej Nowacki
* | Add autotests for setting non-Object as prototype valueKent Hansen2010-11-092-0/+50
| | | | | | | | | | | | Currently it's possible to set the prototype to be any value, but this doesn't make sense; see QTBUG-15154. Mark test as expected failure until it's fixed.
* | Split QScriptValue::call autotest into smaller tests.Jedrzej Nowacki2010-11-052-131/+173
| | | | | | | | | | | | | | The test was testing too much. Split them into more manageable chunks. Reviewed-by: Kent Hansen
* | Refactor tst_QScriptValue::instanceOfJedrzej Nowacki2010-11-012-4/+10
| | | | | | | | | | | | | | The test was divided into two separate cases, it should reduce maintenance costs. Reviewed-by: Kent Hansen
* | Refactor tst_QScriptValue::getSetPrototypeJedrzej Nowacki2010-11-012-30/+63
| | | | | | | | | | | | | | The test was divided into separate cases, it should reduce maintenance costs. Reviewed-by: Kent Hansen
* | Refactor tst_QScriptValue::getSetPropertyJedrzej Nowacki2010-11-012-233/+291
| | | | | | | | | | | | The test was too complex, it was splited. Reviewed-by: Kent Hansen
* | Refactor tst_QScriptValue::getSetDataJedrzej Nowacki2010-11-012-33/+68
| | | | | | | | | | | | | | The test should use _data function. The test was divided into two separate cases, it should reduce maintenance costs. Reviewed-by: Kent Hansen
* | Refactor tst_QScriptValue::isErrorJedrzej Nowacki2010-11-012-8/+31
| | | | | | | | | | | | | | The test should use _data function. It should be easier to maintain that code. Reviewed-by: Kent Hansen
* | Refactor tst_QScriptValue::isRegExpJedrzej Nowacki2010-11-012-10/+23
| | | | | | | | | | | | | | The test should use _data function. It should be easier to maintain that code. Reviewed-by: Kent Hansen
* | Refactor tst_QScriptValue::isDateJedrzej Nowacki2010-11-012-10/+23
| | | | | | | | | | | | | | The test should use _data function. It should be easier to maintain that code. Reviewed-by: Kent Hansen
* | Refactor tst_QScriptValue::isArrayJedrzej Nowacki2010-11-012-9/+22
| | | | | | | | | | | | | | The test should _data function. It should be easier to maintain that code. Reviewed-by: Kent Hansen
* | Increase range of getSetScriptClass test.Jedrzej Nowacki2010-11-012-7/+22
| | | | | | | | | | | | Few bound QScriptValue instances were added to the test. Reviewed-by: Kent Hansen
* | Rename few QScriptValue's test cases.Jedrzej Nowacki2010-11-012-40/+40
| | | | | | | | | | | | | | | | Remove unused suffix "_old" from test cases. The suffix was used to differentiate between a generated test and a standard one. As they are separated now it is not needed anymore. Reviewed-by: Kent Hansen
* | Separate generated tests from hand written ones.Jedrzej Nowacki2010-11-0114-13120/+0
| | | | | | | | | | | | QScriptValue test suit was way too big, so it was difficult to maintain. Reviewed-by: Kent Hansen
* | Split tst_QScriptValue::getSetScriptClass autotest.Jedrzej Nowacki2010-11-012-7/+43
| | | | | | | | | | | | | | The test was too big. More data was added to the part testing non Object behaviour. Reviewed-by: Kent Hansen
* | Split tst_QScriptValue::ctor autotest.Jedrzej Nowacki2010-11-012-88/+162
| | | | | | | | | | | | The test was too big. There should be no difference in coverage. Reviewed-by: Kent Hansen
* | Merge branch 4.7 into qt-master-from-4.7Qt Continuous Integration System2010-10-292-0/+26
|\ \ | |/
| * QScriptValue::construct(): Don't crash if function throws non-ObjectKent Hansen2010-10-282-0/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | If an exception occurs, we should ignore the result of JSC::construct() and return the exception value, even if the exception is not an object. This makes the behavior match the documentation: "Calling construct() can cause an exception to occur in the script engine; in that case, construct() returns the value that was thrown". Task-number: QTBUG-14801 Reviewed-by: Jedrzej Nowacki
* | Merge branch 'qt-master-from-4.7' of ↵Qt Continuous Integration System2010-07-291-0/+4
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | scm.dev.nokia.troll.no:qt/qt-integration into master-integration * 'qt-master-from-4.7' of scm.dev.nokia.troll.no:qt/qt-integration: (407 commits) Cherry pick fix for MOBILITY-1234 from Qt Mobility. Cherry pick fix for QTMOBILITY-408 from Qt Mobility. Cherry pick fix for MOBILITY-1194 from Qt Mobility. Fix compilation error on Symbian^4. Fix detection of OCC functionality. Cherry pick fix for MOBILITY-1194 from Qt Mobility. Fix signal emission of QDesktopWidget on Symbian. Don't run the QGL test on systems that does not have GL support. Adding missing image Fixed gcce linker error when linking against s60main built by armcc. Make it possible again to build Qt without webkit Fixed plugin build key for Symbian builds under Linux. Remove an useless assert from comp_func_SourceOver_sse2() QScriptEngineAgent: recompile all the function when installing a debugger. QScriptDeclarativeObject: we need to save the current stack pointer. QScriptValue::objectId(): do not assert if the value is not a cell Implement the composition mode "Plus" with SSE2 Clean the CompositionFunction tables of drawhelper Fix QT_NO_DATESTRING Check the gesturemanager pointer before accessing it. ...
| * \ Merge remote branch 'origin/4.7' into qt-master-from-4.7Olivier Goffart2010-07-281-0/+4
| |\ \ | | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/gui/kernel/qapplication.cpp tests/auto/qfileinfo/tst_qfileinfo.cpp tools/qdoc3/test/assistant.qdocconf tools/qdoc3/test/designer.qdocconf tools/qdoc3/test/linguist.qdocconf tools/qdoc3/test/qmake.qdocconf tools/qdoc3/test/qt-build-docs.qdocconf tools/qdoc3/test/qt.qdocconf
| | * Add missing API shimsKent Hansen2010-07-071-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | There were still a couple of functions that didn't have them. This could cause said functions to crash if multiple script engines were being used. Reviewed-by: Jedrzej Nowacki
* | | Increase test coverage for QScriptValue.Jedrzej Nowacki2010-07-281-13/+30
|/ / | | | | | | | | | | | | New test value for tst_QScriptValue::getSetData testcase. Setting data is allowed only for an object. Reviewed-by: Kent Hansen
* | Merge remote branch 'origin/4.7' into qt-master-from-4.7Thiago Macieira2010-07-012-2/+89
|\ \ | |/ | | | | | | | | | | | | | | Conflicts: bin/syncqt src/gui/text/qtextlayout.cpp tools/assistant/tools/assistant/helpviewer_qwv.cpp tools/assistant/tools/assistant/helpviewer_qwv.h tools/configure/configureapp.cpp
| * Usefully convert from QtScript object/array to QVariantKent Hansen2010-06-172-2/+89
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For arrays, the conversion would crash if the array was cyclic. Introduce a set that keeps track of which objects are being converted, and return an empty list when a cycle is detected. For other types of objects, the object was previously attempted to be converted to a primitive, which typically meant you would get the string representation ("[object Object]"), since most (practically all) objects can be converted to a string -- not useful at all. Change the conversion so it converts the object to a QVariantMap instead. This was already done for slots that took a QVariantMap as argument, but only one level deep. Make the conversion recursive, using the same mechanism as for arrays to detect cycles. This change also means that you get a meaningful JS object => QVariant => JS object roundtrip. It also aligns the behavior with the Qt WebKit bridge. Update the documentation to describe the new behavior. The 4.7 changelog will also be updated under "important behavioral changes". This change exposed an issue with one of the QML autotests: A JS object was assigned to a QVariant property, which caused it to be converted to a string (rather than a QVariantMap) -- just shows that the previous behavior was unintuitive). Later, this variant property is compared to another object, the intention being to compare the _properties_ of the two objects; but because the variant property contained a string, this would cause the other operand (object) to be converted to a string as well ("[object Object]"), causing a meaningless test pass. Change the test to deserialize both objects using JSON.stringify, and compare the resulting strings, so that actual JS object => QVariant(Map) => JS object roundtrip is tested (the intention). Task-number: QTBUG-3511 Reviewed-by: Olivier Goffart
* | Fix a coding style issue in a generated code in the QScriptValue tests.Jedrzej Nowacki2010-05-121-34/+48
| | | | | | | | | | | | | | | | Fix the generator, few redundant commas and spaces where removed from generated code. The autotest suite wasn't regenerated. Reviewed-by: Kent Hansen
* | QScriptValue autotest generator modification.Jedrzej Nowacki2010-05-121-16/+25
|/ | | | | | | Generator shouldn't leave whitespace at the end of line in the generated code. Reviewed-by: Kent Hansen
* Merge remote branch 'origin/4.6' into qt-4.7-from-4.6Thiago Macieira2010-04-211-0/+12
|\ | | | | | | | | | | | | Conflicts: src/openvg/qpaintengine_vg.cpp src/script/bridge/qscriptqobject_p.h tests/auto/bic/tst_bic.cpp
| * Improve QScript{Engine,Value}::toObject() test coverageKent Hansen2010-04-191-0/+12
| | | | | | | | | | Test that calling toObject() doesn't change the type of the original value.
* | Merge branch '4.6-s60' into 4.7-s60axis2010-03-221-0/+8
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: configure.exe mkspecs/common/symbian/symbian.conf src/gui/graphicsview/qgraphicswidget.h src/gui/kernel/qapplication.cpp src/gui/text/qtextlayout.cpp src/openvg/qpixmapdata_vg.cpp src/s60installs/s60installs.pro tools/runonphone/main.cpp tools/runonphone/serenum_unix.cpp qtextlayout.cpp fixed up together with Eskil. Kept the configure.exe from 4.7 without recompile.
| * Don't assert in QScriptValue::call()Kent Hansen2010-03-181-0/+8
| | | | | | | | | | | | | | | | | | Oops, the case of a non-array object argument wasn't implemented nor tested in the new back-end. This commit brings it in line with the behavior of the old back-end. Also test that QScriptValue::construct() doesn't have the same problem. Reviewed-by: TrustMe
| * Speed up compilation of this test with MSVC.Rohan McGovern2010-02-261-0/+7
| | | | | | | | | | | | | | | | This test includes a source file which is almost half a megabyte in size. When compiling with -O2, MSVC2008 can take over 20 minutes to link this test! Turn off optimization, just for this test.
* | Update src/3rdparty/javascriptcore and adapt src/script to the changesKent Hansen2010-03-101-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Update qscriptvalueiterator test to expect length property when iterating arrays and strings. - Use EvalExecutable::create() instead of EvalExecutable constructor. The constructor is private. - Reimplement getOwnPropertyDescriptor() in all custom script objects. - Remove all reimplementations of getPropertyAttributes(). It doesn't exist in trunk anymore (getOwnPropertyDescriptor() is used instead). - Remove checkDontDelete argument from deleteProperty() reimplementations. The purpose of this argument was to support deleting properties with attribute Undeletable from C++. But it was quite an invasive patch to JavaScriptCore, and it doesn't seem worth it. If this feature is really crucial it should be re-done upstream. One of the tests needed to be updated so it's not sensitive to the C++ undeletability. - Adapt getOwnPropertyNames() reimplementations to signature change. - Add missing QScriptObject structure flags, otherwise we don't get all virtual calls. - Remove our patch for reporting column numbers in the debugger callbacks. It was just too intrusive. As with the checkDontDelete issue, this should be redone upstream if it's really important. In 4.7, QScriptEngineAgent will always report a column number of 1. Other compilation fixes: - InternalFunction::name() takes an ExecState* argument, not GlobalData* - ScopeChain::globalObject is no longer a function but a member variable - ScopeChainNode constructor takes a GlobalObject argument - Heap::collect() is called collectAllGarbage() - JSValue::strictEqual() takes an ExecState* argument - Debugger::exception() takes a bool hasHandler argument - Debugger no longer reports column number (we decided to drop that patch from JSC) - UString doesn't have operator+=(char*) - Update the autotests to reflect the columnNumber=1 change. - Add helper class to avoid crashing inside JSC. Ever since r52856 in WebKit trunk, this is needed. There are probably a lot of other public API functions that need this guard as well, but I'll add them as they are discovered. - Update mkdist-javascriptcore tag, exclude a few more files. - Set ENABLE_JSC_MULTIPLE_THREADS=0 define on Mac due to r52355 in trunk. Reviewed-by: Simon Hausmann
* | Reduce compiling time of QScriptValue autotest suite on Windows.Jedrzej Nowacki2010-03-048-10223/+11412
| | | | | | | | | | | | | | | | | | | | | | | | | | The QScriptValue autotest suite compiles about 24 min with MSVS2008, which is unacceptable. Tests were splited into a few files for better use of distributed compilation. Repeated calls to insert() and operator<<() where replaced by loops, that should reduce time of code optimizing. Reviewed-by: Kent Hansen
* | Optimize QScriptValue autotest generator.Jedrzej Nowacki2010-03-043-173/+245
| | | | | | | | | | | | | | | | | | | | | | | | | | QScriptValue autotest suite compile 24 minutes on MSVS2008 which is unacceptable. Modification tries to reduce the compilation time. Temples were changed to use static arrays of data; instead of inserting values directly, they are inserted in a loop (less code to optimize). Generated code were separated into several files (better usage of distributed compiling). Reviewed-by: Kent Hansen
* | Merge branch 'master' of scm.dev.nokia.troll.no:qt/mobility-staging into ↵Qt Continuous Integration System2010-02-261-0/+7
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | master-integration * 'master' of scm.dev.nokia.troll.no:qt/mobility-staging: Speed up compilation of this test with MSVC. Fix Symbian build when building for WINSCW with abld. Fix file descriptor leak with generic engine on Linux.