aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative
Commit message (Collapse)AuthorAgeFilesLines
...
* Allow JS API in modulesMatthew Vogt2012-01-2430-9/+276
| | | | | | | | | Allow modules to export verisoned javascript code into specified namespaces. Task-number: QTBUG-20857 Change-Id: Ic968c697ba36cbc4535870ed5eed2fe7f01af11d Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* Console API: Add console.exceptionAurindam Jana2012-01-242-0/+79
| | | | | | | | | console.exception writes a message to the console and prints the JavaScript stack trace at the point where it is called. Change-Id: Idd2ff5982826accae0895db44c7ecf6130338cc7 Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
* Console API: Add console.assertAurindam Jana2012-01-242-0/+82
| | | | | | | | | console.assert tests if an expression is true. If it is false, it writes a message to the console and prints the JavaScript stack trace at that point. Change-Id: I5487552cb8a947e1947914166834e0bdedba3354 Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
* Console API: Add console.countKai Koehne2012-01-244-10/+54
| | | | | | | | console.count can be handy to check how often code snippets are executed. Change-Id: I0eaf17ab893c76e7b8956122aa31e218745e92bf Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
* Fixed compile.Rohan McGovern2012-01-242-40/+79
| | | | | | | | | QEventLoop::DeferredDeletion was deprecated long ago, and finally has been removed. Replace it with QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete) Change-Id: Ic03f26a57efeb35aefab67a913f56001303aa3e4 Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* Update obsolete contact address.Jason McDonald2012-01-2386-86/+86
| | | | | | | | Replace Nokia contact email address with Qt Project website. Change-Id: I6a730abc0c396fb545a48b2d6938abedac2e3f1c Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com> Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
* Add QJSValue::callAsConstructor() functionKent Hansen2012-01-202-43/+43
| | | | | | | | | | The old name, construct(), was bad. This name is more descriptive and consistent with the other callXXX() functions. Task-number: QTBUG-23604 Change-Id: Ie205b0c52721782101e665f7dfedcac9051a00d0 Reviewed-by: Simon Hausmann <simon.hausmann@nokia.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* Add QJSValue::callWithInstance() functionKent Hansen2012-01-202-26/+26
| | | | | | | | | | | | | | With the deprecated call() overload, it was confusing what the first argument was (the this-object or an actual argument passed to the function). Introduce a dedicated function for the "explicit this-object" case. This makes code more readable, and eliminates the need to pass a "dummy" this-object to call() in the quite common case where you don't care about the this-object. Task-number: QTBUG-23604 Change-Id: I18f8be6592a848436351516bea266fc7e9195777 Reviewed-by: Simon Hausmann <simon.hausmann@nokia.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* Add QJSValue::call() overloadKent Hansen2012-01-203-21/+21
| | | | | | | | | | | | This overload takes only an argument list, not a this-object, since that is a very common way of calling stand-alone ("non-member") functions. Now there is no longer a need to pass a dummy value for the this-object. Task-number: QTBUG-23604 Change-Id: Iae952d91fce5bcaa62a05b9978c15f32802da90a Reviewed-by: Simon Hausmann <simon.hausmann@nokia.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* Add QJSValue::isCallable() functionKent Hansen2012-01-202-106/+106
| | | | | | | | | | | This replaces the isFunction() function. isFunction() will be removed. It's possible that objects are callable even if they aren't Function instances. Also, "isCallable" is consistent with call(). Task-number: QTBUG-23604 Change-Id: I42e0ab2ad9dc84e7793199254bbd89d5c9466e6a Reviewed-by: Simon Hausmann <simon.hausmann@nokia.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* Add QJSValue::toInt() and toUInt()Kent Hansen2012-01-204-221/+221
| | | | | | | | | | These replace toInt32() and toUInt32(), which are obsolete and will be removed. Task-number: QTBUG-23604 Change-Id: I83c055dbbe399fa7242889cee8a177440a693d9a Reviewed-by: Simon Hausmann <simon.hausmann@nokia.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* Add QJSValue::deleteProperty() functionKent Hansen2012-01-202-0/+48
| | | | | | | | | | | This makes it possible to delete a property without relying on passing a QJSValue of invalid type to setProperty() (the invalid type is going to be removed). Task-number: QTBUG-23604 Change-Id: I653b3349050ad1aac1cf6ccc8547c753abbb9f1d Reviewed-by: Simon Hausmann <simon.hausmann@nokia.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* Add QJSValue::hasProperty() and hasOwnProperty() functionsKent Hansen2012-01-202-0/+55
| | | | | | | | | | These functions provide a way of querying whether a property exists, without relying on the QJSValue invalid type (which will be removed). Task-number: QTBUG-23604 Change-Id: I2efd53a1e54cc202ecc022d12730b2775384cf53 Reviewed-by: Simon Hausmann <simon.hausmann@nokia.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* QtDeclarative Tests build fixAnselmo L. S. Melo2012-01-201-2/+2
| | | | | | | QBool was removed from QtBase in change I6642f43f: "Remove QBool and use bool instead". Change-Id: Icc037d4201a007f9df0f7c79b19808dc174c218f Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* Assigning empty object to Q_PROPERTY(QVariantMap)Matthew Vogt2012-01-193-1/+124
| | | | | | | | | Correct the evaluation of an empty javascript object during assignment to a QVariantMap property. Task-number: QTBUG-23586 Change-Id: Ifa891a017690a36bd5837bc6b4dd0e47eb515a46 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Move accessibility test to QtQuick 2.Frederik Gladhorn2012-01-188-823/+0
| | | | | | | | The test now only depends on Quick 2 and no longer a mix of widgets, Quick 1 and 2. Change-Id: I3120e11dadb8bb7d7635e6baa1cb905d917353ea Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
* Allow QML URLs to contain pre-encoded octetsMatthew Vogt2012-01-186-2/+201
| | | | | | | | | Use QUrl Tolerant parsing mode to permit user-supplied URLs to contain pre-encoded octets which are not mangled by string conversion. Task-number: QTBUG-22756 Change-Id: I4b160b04340b95221d1eb3336bda8c0b38d2e232 Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* Debugger: Simplify protocol of QDebugMessageServiceKai Koehne2012-01-171-8/+2
| | | | | Change-Id: I3f97a344b8d0e0d73a75e84310c1e8ed59573ee7 Reviewed-by: Aurindam Jana <aurindam.jana@nokia.com>
* Update copyright year in Nokia copyright headers.Jason McDonald2012-01-173-3/+3
| | | | | | | | Update copyright headers from before 2011, and a couple of new ones that were merged after the previous change to copyright headers. Change-Id: Ia76e08e2734afa4ef3f1207dbcda5ff3bc81b366 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Console API: Add console.infoKai Koehne2012-01-162-0/+2
| | | | | | | | Add console.info for the sake of completeness. It's mapped to qDebug(), just like console.log, console.debug, print. Change-Id: Ife1cfbfe810d4e5e9175343778dff734a56f4a80 Reviewed-by: Aurindam Jana <aurindam.jana@nokia.com>
* Console API: Autotest reshufflingKai Koehne2012-01-169-149/+277
| | | | | | | | | Move the console tests from qdeclarativeqt to qdeclarativeconsole, and the test for the QML_CONSOLE_EXTENDED property to debugger/qdebugmessageservice. Change-Id: I704bd0a4a28aa1b0eb51df67d32fd6865b114d41 Reviewed-by: Aurindam Jana <aurindam.jana@nokia.com>
* lower case QML components are accepted when used with 'as' importMatthew Vogt2012-01-1618-1/+46
| | | | | | | | | If an Object Binding is in a namespace, ensure that the Component name begins with a capital letter. Task-number:QTBUG-20786 Change-Id: Id4a0c0fdb0c9b9516bea597a4994bb7519339bc9 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* Use QGuiApplication, not QApplication, in testsDamian Jansen2012-01-131-3/+3
| | | | | Change-Id: I7802293e6cafb90686c103972bc036cf74184714 Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
* Accessibility: indexOfChild is 0-based.Frederik Gladhorn2012-01-121-0/+6
| | | | | | | Also test for it to work. Change-Id: I3be913984e2dddce241b538c7801f3376acdd1fa Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
* Make QAccessibleQuickView::childAt() work properly with overlapping itemsJan-Arve Saether2012-01-123-17/+232
| | | | | | | | | | | | | | | | | | | | The previous code did not consider items that were overlapped due to having different z coordinates. The approach used is now the same as found in QQuickCanvas::mousePressEvent(). Strictly speaking, this is a violation of childAt (since it will disregard the implementation of childAt of all the descendants along the path down to the item actually returned.) However, I don't see any good reason for that the implementation for childAt() would be different than how mousePressEvent behaves. It should also perform better than any other solution I managed to think of. Change-Id: I2d3fa2282437c7b5533c6149c62fc456ccf2ccfa Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
* Remove obsolete toBoolean() and isBoolean() QJSValue gettersSimon Hausmann2012-01-112-58/+58
| | | | | | | We should use "toBool" and "isBool" for consistency with QVariant. Change-Id: I266f2a36a034a5b323e614777ceacbc0d2ffec16 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* Accessibility: Checked state for check boxes and radio buttons.Frederik Gladhorn2012-01-102-42/+74
| | | | | | | Also adapt to new api in qtbase - state is now a bit field. Change-Id: Ia4266f3d5094a6c32e0ace3499910b57c3e71c25 Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
* QDeclarativeDebug: Add a debug message service.Aurindam Jana2012-01-094-1/+260
| | | | | | | | | | | QDeclarativeDebugMsgService installs a QtMsgHandler which forwards debug output to a client defined port only if the service is Enabled. It also forwards the debug output to the previous message handler. Effectively, this service just eavesdrop on debug output, forwarding it to a port only if a client is connected. Change-Id: Ie0ee7bab57ef8f03a2de34d91921f054a7ec147f Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
* Improve QML error messagesAaron Kennedy2012-01-067-7/+7
| | | | | | | | Point at the actual property and method name when raising errors about them. Change-Id: Id36df4850b91ae0d225fcda4d101f4b2a073a72e Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
* Skip unreliable autotestAaron Kennedy2012-01-051-0/+4
| | | | | | Task-number: QTBUG-23475 Change-Id: I2c500f24a307574b88357a9f128d4ff0a1b8eb91 Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
* Update copyright year in license headers.Jason McDonald2012-01-0581-81/+81
| | | | | Change-Id: I0a8d99909cac867dce72da70b1bbcb649989a51b Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Eliminated usage of qttest_p4.prf in newly added test.Sergio Ahumada2012-01-051-2/+4
| | | | | Change-Id: I8f531276e1d769be116fea155c4c68cd698b8fec Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Fix moving mixed visible and non-visible View items.Andrew den Exter2012-01-041-0/+19
| | | | | | | | | | | | | | A removal for a move that included both cached and non-cached was only evaluating the first part of the removal and skipping the remainder. Don't skip all subsequent removals when two ranges are merged, instead reset the current indexes to the start of the merged range and continue on as normal. Task-number: QTBUG-23432 Change-Id: Ieda49e2f68cd0bbbd31ba1e7dfd5af7c3e350d78 Reviewed-by: Bea Lam <bea.lam@nokia.com>
* Fix test failures with shadow builds.Andrew den Exter2012-01-0327-93/+92
| | | | | | | | | | QFINDTESTDATA uses __FILE__ to determine the source directory, which means it finds the wrong source directory when the macro is used from a shared base class. Define the correct source directory in a pri file and include that wherever QDeclarativeDataTest is used. Change-Id: If3ef435f4bb3049733f49402338303c8b440f1fa Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* Add accessibility to qmlFrederik Gladhorn2012-01-025-0/+570
| | | | | | | | | | | | | | | This consists of two parts: An attached property for QML items and a plugin for the accessibility framework. The attached property simply takes care of some properties (name, role) that are needed in order to expose semantics of the application to assistive tools. The plugin exposes the hierarchy of QML items to the accessibility framework. Change-Id: I32f5603d0d9549b01b3645b205b710b9801762f7 Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
* Handle exceptions inside QV8QObjectConnectionList::qt_metacallChris Adams2011-12-292-0/+39
| | | | | | | | | Previously, exceptions were not handled in the connectionlist. This could cause v8 to assert under certain circumstances. Task-number: QTBUG-23375 Change-Id: Ie5f043b50bb6b02a77be464ca18ea8e3bbb0f501 Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
* Insert items into VisualDataModel.Andrew den Exter2011-12-231-7/+7
| | | | | | | | | | | Add API for inserting data directly into a VisualDataModel which can be used among other things to create temporary items that are later resolved to an actual item in the source model. Task-number: QTBUG-21516 Change-Id: I835f0e8d6c5edfb3a21029687de5b700f7400317 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Minimize the number of objects created per item in VisualDataModel.Andrew den Exter2011-12-231-8/+2
| | | | | | | | | | | | | | Derive from QDeclarativeContext and reference count the context object instead of parenting it to the context. Combined with a weak persistent v8 handle the allows the context object to be returned by javascript accessors instead of creating a new instance for every use. In addition to the efficiency advantages of creating fewer objects, routing all data access through a single object means that object can also persist data instead of just acting as a proxy. Change-Id: I107dc8c901f16f2a4b420ff1cbffa7a6be27de89 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Fix crash in var property setterChris Adams2011-12-233-0/+14
| | | | | | | | | | | Previously, the function didn't terminate after calling the setter recursively, as it should have. This patch ensures that the setter is called correctly and then returns, and adds a unit test to ensure that no regression occurs. Task-number: QTBUG-23330 Change-Id: If512fca174e5224c2c53caad11f77782e6cead9f Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
* Detect and optimize qsTr() and qsTrId() bindingsAaron Kennedy2011-12-214-0/+34
| | | | | | | | | As these two are frequently used with constants, we can detect them in the compiler, and run the appropriate C++ functions directly in the VME. This saves pointlessly creating and running bindings. Change-Id: I148a150400c13fda7955949453405202f18b1a6b Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* QDeclarative tests: Introduce base class for data tests.Friedemann Kleint2011-12-2152-876/+834
| | | | | | | | | | | | | | | | | In tests/auto/shared/util.* replace macros/find functions by a base class QDeclarativeDataTest with accessors for the data directory helper functions to create URLs from it. The class relies on QFINDTESTDATA, which is the standard way of locating test data. Using the class should reduce the number of calls to QFileInfo.exists(), etc significantly. In addition, provide utility functions for messages. Reviewed-by: Michael Brasser <michael.brasser@nokia.com> Change-Id: Id2beacb157922ee9412f9e45cf9695cec1f8379a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* qdeclarativexmlhttprequest: Stabilize, ensure deletion of server.Friedemann Kleint2011-12-201-3/+3
| | | | | | | | | Introduce QScopedPointer to make sure the server is also deleted in case the test fails thus suppressing follow-up errors caused by the port still being in use by a leaked server. Change-Id: I9fd8a96ea5aba42487df8f22bc9a79917b9d8c16 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Qt.locale() always returns the 'C' locale.Martin Jones2011-12-201-0/+12
| | | | | | | | QLocale(QString()) does not return the default locale. If no locale is specified, use the QLocale() constructor. Change-Id: I76198b7ea66a6326483ec47ac36e080159ca459a Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Fix QDeclarativePropertyCache crash.Andrew den Exter2011-12-202-0/+289
| | | | | | | | | | | | Reserve enough space in the signalHandlerIndexCache so that it will not reallocated while the property cache is being built as this will invalidate the pointers stored in the stringCache. Also ensure signals for all cached meta-objects are included in signalHandlerIndexCache, and don't over allocate propertyIndexCache and methodIndexCache. Change-Id: Ic285d832d4b86106176bfe723ff10bdd65143910 Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* Correctly resolve elements of QList<QUrl> propertiesChris Adams2011-12-192-0/+61
| | | | | | | | | | Previously, the value of a QList<QUrl> sequence was only resolved if there was only one element in the sequence. This commit ensures that all elements in the sequence are resolved correctly. Task-number: QTBUG-23131 Change-Id: Id27748853fe01ae22800fbd02d062e268ad7ec70 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* Remove another fragile assumption from var prop unit testChris Adams2011-12-191-1/+2
| | | | | | | | | Commit 32c6ba2c3802bfda11e455c8aaaee41662c237fb removed hardcoded prop indices from one test, but missed another test case which also hardcoded a property index. Change-Id: Iaac863f8176d09077ce1773b642cb88a01cc3fd1 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* DeclarativeDebug: Add version info to service pluginsAurindam Jana2011-12-165-26/+16
| | | | | | | | Send the version info of each plugin alongwith the plugin names to client. Change-Id: I223689b32cdc5b0c48a4f508330033352b427937 Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
* V8: Remove extra V8::Context allocated for expressing strong referencesSimon Hausmann2011-12-152-5/+29
| | | | | | | | | | | | 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>
* Add support for QUrl types to V4Roberto Raggi2011-12-153-0/+38
| | | | | | | | | | | | | Extended the V4 instruction set with instructions to `fast convert' url registers to string and bool registers and `resolve' urls using QDeclarativeContext::resolvedUrl. Also, made IR::UrlType a special `string' type. It's a little trick to ensure that the compiler will generate correct conversions for the binary expressions. Change-Id: Ibc9e5b99302bd513f0cc52b598a1b198b11d4d30 Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
* QV8DebugService: add version commandAurindam Jana2011-12-151-0/+21
| | | | | | | Version command to retrieve debugger version info. Change-Id: I711e2a3d639c648cef50498fe5bbb9b6b8c6c1fe Reviewed-by: Kai Koehne <kai.koehne@nokia.com>