Commit Graph

1083 Commits

Author SHA1 Message Date
Matthew Vogt c5cd60a96d Ensure JS files imported inside modules work correctly
When a module exports functionality provided by a script, ensure
that imported script modules inside that script resolve correctly.

Task-number: QTBUG-24596
Change-Id: I3885dcc56946423f0d7cf00afdcdfaa0cb11967a
Reviewed-by: Chris Adams <christopher.adams@nokia.com>
2012-03-19 23:20:30 +01:00
Aurindam Jana 3a3515b5a7 QmlEngineDebug: Simplify the utility classes
Change-Id: Ie0e1b6e9edd6a09fef565635cc793f8bdb6c42e7
Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
2012-03-19 17:07:27 +01:00
Aurindam Jana 7f963aa41d QmlEngineDebug: Rename to QmlEngineDebugClient in AutoTest
Change-Id: If20b53d2e47cdc4ed54df0d9360ae1b0566489c6
Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
2012-03-19 17:07:15 +01:00
Miikka Heikkinen 37bd02abf1 Fix data file checkout formats in Windows for some declarative tests
Fixed by adding proper .gitattributes for the tests

Task-number: QTBUG-24780
Change-Id: If8de0161a377c21fb5c6327d69e8da84174ee435
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-03-19 16:58:21 +01:00
Kai Koehne 69835e0f34 Debugger: Always disable v4 optimizer if v8 debugger is activated
Don't rely on QML_DISABLE_OPTIMIZER environment variable being set.

Change-Id: Ib1a9d83eb9698adcd3c9a5bbcc74cba382836078
Reviewed-by: Aurindam Jana <aurindam.jana@nokia.com>
2012-03-19 14:35:55 +01:00
Aurindam Jana bfedb27838 QmlEngineDebugService: Rename service to QmlDebugger
Rename service from QDeclarativeEngine to QmlDebugger.
Send a response for each query.

Change-Id: I01cfeaf3e4116bfd7029d170ee228c159973947c
Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
2012-03-19 14:35:54 +01:00
Simjees Abraham e0e81d6f20 Debugger: Add optional 'host' argument to -qmljsdebugger
Change-Id: I5bb2e48e2ad2019b8a92f6f8842b88027fcd2d28
Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
2012-03-19 12:05:03 +01:00
Aurindam Jana 5c05f5df1f QmlDebuggingTests: Separate out public and private tests
Remove dependencies on quick-private from all
possible debugging auto tests and list them under public
tests.

Change-Id: I688b5b36fdf3d6fbcb6cef2a975ecd1bf679af2b
Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
2012-03-19 12:04:54 +01:00
Charles Yin ba8a50ae80 Skip some font loader tests for Windows
Windows currently does not support font loader yet.

Change-Id: I370e41c1f2e2a45787741414a6e7bf00cc3f6c3e
Reviewed-by: Martin Jones <martin.jones@nokia.com>
2012-03-19 12:02:48 +01:00
Charles Yin b236cf6f41 Make qqmlinspector test work on Windows
Change-Id: Ib7399f9a005d3674fcb46c605cea3a8d40c21284
Reviewed-by: Martin Jones <martin.jones@nokia.com>
2012-03-19 12:02:48 +01:00
Aurindam Jana cad5df2572 QmlDebugging: Object Tree and States List
All created instances are stored under the root context.
Check for the creation context of the object when building
up the tree. Do the same when building up the states list.

Change-Id: I8716d9966a61b8f7cb3ad4b7ab5acd4c94b4cd03
Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
2012-03-19 10:49:45 +01:00
Martin Jones af3a8708b4 When clearing an incubator also clear incubators it is waiting for.
If an incubator is cleared while waiting for other incubators
to complete also clear the incubators it is waiting for.

Change-Id: I83470920c0fd8a23d0098849192555f7478bb492
Reviewed-by: Andrew den Exter <andrew.den-exter@nokia.com>
2012-03-19 10:49:39 +01:00
Martin Jones 6deb3ceffa Resetting a model can cause a crash in views with header/footer.
Geometry listeners were called for deleted header/footer.

Change-Id: I47854178232f8a4ab5e19a931901b49741fec388
Reviewed-by: Bea Lam <bea.lam@nokia.com>
2012-03-19 10:49:21 +01:00
Martin Jones f079f789c5 Ensure section header/footer are cleaned up.
If the model is cleared or replaced with an empty one,
the section headers should be released.

Change-Id: Ia2f070c312593743b2c5332a6c69facaf222ee6d
Reviewed-by: Bea Lam <bea.lam@nokia.com>
2012-03-19 10:49:05 +01:00
Andrew den Exter 6cb590105f Fix QQuickCanvas test failure.
Switch to a QTRY_COMPARE to allow a little more time processing the
event loop.

Change-Id: I4f14feb5cbc7d11654f6c9089baff4ae67d894db
Reviewed-by: Martin Jones <martin.jones@nokia.com>
2012-03-19 08:30:23 +01:00
Michael Brasser 20ffaaf297 Fix bug in v4 strict equality.
Change-Id: I184065e0b7c8c6536f2081b9bf03e98992a4c9fe
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
2012-03-15 13:18:17 +01:00
Miikka Heikkinen 21e228afa7 Windows: Fix file URL issues in declarative autotests
Fixed by using testFileUrl() shared utility function where appropriate
instead of testFile() or various other ways file URLs were being
incorrectly used.

Task-number: QTBUG-24779
Change-Id: I48cbd297d419238f42ea45132344b7e5a487b6f1
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-03-15 11:25:36 +01:00
Miikka Heikkinen 5adfdaf9b3 Fix tst_qquickimageparticle test compilation with Visual Studio
MSVC doesn't support setenv or unsetenv functions, so use
qputenv instead.

Change-Id: Ife4eb056e6c87d23774512c61b13a3ae3d8ac9ce
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-03-15 10:14:37 +01:00
Martin Jones 31467e8649 Allow threaded compilation in an async Loader
Enables threaded compilation for a Loader "source".

Change-Id: I2d60a3ace07aab58f3b8f069e45a2864178c959f
Reviewed-by: Chris Adams <christopher.adams@nokia.com>
2012-03-15 10:14:37 +01:00
Alan Alpert 67f589209d Don't assert if focus is already clear.
Already cleared focus should exit the function without terminating the
runtime.

Task-number: QTBUG-24714
Change-Id: Ia8c6be0d88e43d1f71112acc7bac3eb674f22de8
Reviewed-by: Martin Jones <martin.jones@nokia.com>
2012-03-15 10:14:37 +01:00
Martin Jones d7f2a77f2b Set more sensible Flickable default input filtering parameters
Shouldn't throw anything away by default.  Also fix bug that
flicking back into bounds from outside bounds halved velocity.

Change-Id: I3c2d303a9e46910439dc8bfb01771376f634a684
Reviewed-by: Laszlo Agocs <laszlo.p.agocs@nokia.com>
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
2012-03-15 04:22:43 +01:00
Chris Adams 25793276e5 Fix crash caused by dereferencing collected v8 data
If a var property of a QObject is read after the v8 data associated
with the qobject has been deleted but prior to the DeferredDelete
event being processed, the varProperties array will be null and
a crash will occur.

This patch ensures that we check for this condition in both the
access and set codepaths for var properties, and also ensures
that an object which has previously been queued for deletion cannot
be referenced in JS.

Finally, it adds a unit test to ensure that we don't regress.

Task-number: QTBUG-24748
Change-Id: Idde384ca01e18f4dcf9e376e9379f2c5eb410e14
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
2012-03-15 02:44:40 +01:00
Chris Adams 147247a31a Don't allow tst_QJSEngine or tst_QJSValue instance to be collected
Both of those unit tests currently change the ownership of the test
instance object, which could result in it being collected by the JS
GC and deleted if events were processed.

Change-Id: I5a9821fb56e19af1d52fea46e54755875dfbb29a
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
2012-03-15 02:44:40 +01:00
Aaron Kennedy 5ae8caba10 Remove binding dependency on QQmlExpression
This is the first step to creating much lighter weight bindings that
are tuned for the specific scenario in which they're used.

Change-Id: Ib985dcff25679b711b5c634bbc891aa7902bf405
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
2012-03-15 01:33:24 +01:00
Chris Adams b06108350b Ensure that dynamic property storing QObject ptr notifies on delete
Previously, when a QObject ptr was stored in a dynamic variant
property, the value of the property could change (to a zero ptr)
if the QObject was deleted without a notify signal being emitted
by the QDeclarativeVMEMetaObject which stores the property.

This commit ensures that such a notify signal is emitted correctly.

Task-number: QTBUG-23451
Change-Id: I5689abd984b177737f8d5f18950838b73ebde328
Reviewed-by: Martin Jones <martin.jones@nokia.com>
2012-03-15 00:22:45 +01:00
Kent Hansen a27fd584df Let V8 throw the exception when QML property lookup fails
Only V8 knows whether a failed property lookup should actually cause
a ReferenceError to be thrown. When evaluating a "typeof" expression,
for example, a ReferenceError should not be thrown even if the
expression involves global variables that don't exist, according to
the ECMA-262 specification.

QML should try to match the standard JavaScript behavior. This is
achieved by simply returning an empty value handle (to signify the
absence of the property), and leaving it to V8 to throw an exception
as appropriate.

Task-number: QTBUG-21864
Task-number: QTBUG-24448
Change-Id: I9945adcab98fc3b801371163367473d6af0ab31a
Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
2012-03-14 19:49:35 +01:00
Miikka Heikkinen 8f077f28c5 Remove warning about missing file from parserstress test
There is no dummy.qml, so trying to find it will cause a warning
and return an empty string. Since the url is optional anyway and
apparently not relevant to this test, just use empty QUrl directly.

Change-Id: I11ba742dedccd6bdea226f680aa57c957afc7dc7
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-03-14 17:58:22 +01:00
Miikka Heikkinen dfe32bec2d Windows: Mark several declarative test cases insignificant
These tests are marked insignificant for now to make CI runs pass.
Insignifications need to be removed once the related issues are fixed.

Change-Id: I3a1d36e5b17cf2f1b2f00b20b615359d96975f2b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-03-14 17:58:22 +01:00
Kent Hansen f91dba1274 Use the same ReferenceError message wording as V8
Instead of "Can't find variable: foo", use "foo is not defined".

This is in preparation of letting V8 throw the exception when a
property lookup fails on the QML scope object (needed for
QTBUG-24448).

Change-Id: I3c747482a8ef138dad9a85530a4f6b5c4c818a03
Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
2012-03-14 16:45:30 +01:00
Kai Koehne e1d688a237 Debugger: Print informational messages via qDebug
This allows users to use QT_FATAL_WARNINGS.

Change-Id: I114825764c841030418c956d23575159157dfd69
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
2012-03-14 15:32:55 +01:00
Kai Koehne d6c666f73f Debugger: Fix autotest for shadow builds
Change-Id: I1b53afeb2a9f0d6e571c5ed87304e85896523488
Reviewed-by: Aurindam Jana <aurindam.jana@nokia.com>
2012-03-14 15:32:55 +01:00
Kai Koehne 39327bbe38 Debugger: Fix autotests on Windows
Remove export macro logic for internal classes.

Change-Id: I4dfa7f8e7bc9b5086e01e40342bd00812d5966bd
Reviewed-by: Aurindam Jana <aurindam.jana@nokia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-03-14 12:52:58 +01:00
Caroline Chao c8262855f4 CodeCoverage: Skip headersclean test.
The code coverage tool adds #line when instrumenting the code using the gcc
syntax.

tst_headersclean uses the -pedantic-errors flag which causes a fatal error
when the code is instrumented with the coverage tool.

Similar change was done for qtbase (4ee14d6f87688492).

Change-Id: I525879ef56463473dd3c9eb91dee4d9b8310cdf9
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-03-14 10:26:52 +01:00
Luis Gabriel Lima b7f3138957 Fix AND expression in v4
The type of the and expressions, e.g. (a && b), were being assigned
to the type of the right hand expression (b). As reported in
QTBUG-24660, this approach could lead to some unexpected behaviors.

Now, when the left and right hand expressions are of different types,
the responsability to deal with the and expression is delegated to v8.

Task-number: QTBUG-24660
Change-Id: Ic42ebb035e62e2f197c337b2106d00453a99f04c
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
2012-03-14 10:26:52 +01:00
Chris Adams d73e6d4374 Disable particle-related examples from tst_examples
CustomParticle and ShaderEffect are currently broken.
Disabling these examples until they can be fixed.

Task-number: QTBUG-24034
Change-Id: Ic1ebba1f66f28495822cd729af1e1c24acad79da
Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
2012-03-14 09:14:32 +01:00
Martin Jones 34280c409d Reuse a QQuickCanvas in examples auto test.
Much faster than creating a new one for each example.

Change-Id: Ic32f244047e0dba78134ba0e3d368260be838f1e
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
2012-03-14 04:20:17 +01:00
Michael Brasser 665f860d9a Support module api objects in v4.
Change-Id: I72911a2c8e0a8613e53861da7b38312e51bf57da
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
2012-03-14 01:12:35 +01:00
Martin Jones 89d6599de9 Reuse QQuickView in GridView table driven tests
Makes the tests run faster since we're not waiting for a
window to appear all the time.

Change-Id: Id2442cf32055084088c19865499055c7282bcae0
Reviewed-by: Bea Lam <bea.lam@nokia.com>
2012-03-14 01:12:19 +01:00
Charles Yin c67ed6887a More refactoring on animation controller
Add a flag and helper functions for disabling user control in QAbstractAnimationJob
class and make it synchronized with QDeclarativeAnimation class's disableUserControl
flag.

Change-Id: Ifa84ab0c78291941469c33f2cafe5f61ee718b2c
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
2012-03-13 23:50:52 +01:00
Casper van Donderen c291efff26 Remove the usage of deprecated qdoc macros.
QDoc now has support for Doxygen style commands for italics, bold
and list items. This change applies that change in QDoc to the
actual documentation.

Task-number: QTBUG-24578
Change-Id: I62d203f21df63a95ee236e578b10418fd9680707
Reviewed-by: Jerome Pasion <jerome.pasion@nokia.com>
2012-03-13 16:34:49 +01:00
Charles Yin ada9dd41c8 Implement mouseDrag
Simulates the drag behavior by press-move-move-release mouse events,
we need 2 move events here to trigger the drag threshold.

Task-number: QTBUG-22753
Change-Id: Ic3470c061834b7410c524029d82375cba62afa36
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
2012-03-13 15:17:18 +01:00
Aurindam Jana 69a1bf1648 QmlDebugging: Modify test JSDebug test cases
Add signals that are emitted on debugger responses for
flaky auto tests.

Change-Id: Ic59f559083b2b19fb8eec920dcb76f23125639a8
Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
2012-03-13 12:39:31 +01:00
Martin Jones 70ac6b1705 Reuse QQuickView in ListView table driven tests
Makes the tests run faster since we're not waiting for a
window to appear all the time.

Change-Id: Ibff3706873dbad2f92d2135eae260368f4f4bb10
Reviewed-by: Bea Lam <bea.lam@nokia.com>
2012-03-13 09:47:23 +01:00
Toby Tomkins d541fdcbe6 Default image scaling behaviour has changed; fix autotest.
The default image scaling behaviour has changed in qtdeclarative. This
change fixes the autotest to conform to fixed ratio scaling.

Change-Id: I9c901825295fb04cab74c46f61696c5274ddd943
Reviewed-by: Martin Jones <martin.jones@nokia.com>
2012-03-13 06:53:11 +01:00
Chris Adams fa9fcf2fb2 Fix crash when writing property after engine deletion
Previously, the engine pointer stored in a QQmlProperty could be
stale due to engine deletion.  This commit ensures we guard that
pointer.

Also reverts cbb7f8b10e

Task-number: QTBUG-24734
Change-Id: I5349c51fbd19fa46a8710280173c1d224358b96e
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
2012-03-13 05:13:50 +01:00
Martin Jones 648c80c4c0 Speed up view flick tests.
Change-Id: I98b0a45b5afd0150bfacef2c1c1e814f70ae042f
Reviewed-by: Bea Lam <bea.lam@nokia.com>
2012-03-13 03:24:54 +01:00
Martin Jones a4d22cbb38 ListView.contentHeight does not include header and footer item heights
Task-number: QTBUG-24664

Change-Id: I2a2fe144835e61665b8693d58ca4fb9ba506e8a8
Reviewed-by: Bea Lam <bea.lam@nokia.com>
2012-03-13 02:02:49 +01:00
Chris Adams c71db2cf82 Fix leak in tst_qquicklistmodel unit test
Change-Id: I6883f263648d425240503f6abbd358b744d68506
Reviewed-by: Glenn Watson <glenn.watson@nokia.com>
2012-03-13 02:02:49 +01:00
Bea Lam 52d3d361a0 Displaced items were moving unnecessarily
They should only move if they actually change from the last set
position, and not if they are simply changing from their current item
position, as that is wrong during an animation.

This also cleans up some code for resetting the transition data.

Task-number: QTBUG-24586
Change-Id: I0a6635903975ebc40d5cf8398b943a9de92d4493
Reviewed-by: Martin Jones <martin.jones@nokia.com>
2012-03-13 02:02:49 +01:00
Glenn Watson be8675ab01 Change repeater item to handle model being deleted.
The repeater item previously stored a raw QObject pointer in
a variant. When this pointer was a dynamic list model element
that was deleted, the variant would continue to hold a stale
pointer. Change repeater to use a guard object to hold the model
when it is a QObject. Continue to use a variant to hold models
that are not based on QObject to maintain same semantics.

Change-Id: Ie100947132923803263c725e86efa68206382f12
Reviewed-by: Martin Jones <martin.jones@nokia.com>
2012-03-13 02:02:49 +01:00