summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/declarative/qdeclarativeanimations/tst_qdeclarativeanimations.cpp4
-rw-r--r--tests/auto/declarative/qdeclarativedom/data/import/Bar.qml (renamed from tests/auto/declarative/qdeclarativedom/data/importdir/Bar.qml)0
-rw-r--r--tests/auto/declarative/qdeclarativedom/data/importlib/sublib/Foo.qml (renamed from tests/auto/declarative/qdeclarativedom/data/importlib/sublib/qmldir/Foo.qml)0
-rw-r--r--tests/auto/declarative/qdeclarativedom/data/importlib/sublib/qmldir1
-rw-r--r--tests/auto/declarative/qdeclarativedom/tst_qdeclarativedom.cpp3
-rw-r--r--tests/auto/declarative/qdeclarativeinstruction/tst_qdeclarativeinstruction.cpp13
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/importNewerVersion.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/importNewerVersion.qml3
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/importNonExist.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/importNonExist.qml5
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp2
-rw-r--r--tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp5
-rw-r--r--tests/auto/declarative/qdeclarativeloader/data/differentorigin.qml3
-rw-r--r--tests/auto/declarative/qdeclarativeloader/data/sameorigin-load.qml3
-rw-r--r--tests/auto/declarative/qdeclarativeloader/data/sameorigin.qml3
-rw-r--r--tests/auto/declarative/qdeclarativeloader/tst_qdeclarativeloader.cpp41
-rw-r--r--tests/auto/declarative/qdeclarativemoduleplugin/data/works.qml (renamed from tests/auto/declarative/qdeclarativemoduleplugin/plugin.qml)0
-rw-r--r--tests/auto/declarative/qdeclarativemoduleplugin/imports/com/nokia/AutoTestQmlPluginType/qmldir (renamed from tests/auto/declarative/qdeclarativemoduleplugin/com/nokia/AutoTestQmlPluginType/qmldir)0
-rw-r--r--tests/auto/declarative/qdeclarativemoduleplugin/plugin/plugin.pro2
-rw-r--r--tests/auto/declarative/qdeclarativemoduleplugin/tst_qdeclarativemoduleplugin.cpp7
-rw-r--r--tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp33
-rw-r--r--tests/auto/declarative/visual/animation/parentAction/data/parentAction.0.pngbin1652 -> 0 bytes
-rw-r--r--tests/auto/declarative/visual/animation/parentAction/data/parentAction.1.pngbin1492 -> 0 bytes
-rw-r--r--tests/auto/declarative/visual/animation/parentAction/data/parentAction.2.pngbin1424 -> 0 bytes
-rw-r--r--tests/auto/declarative/visual/animation/parentAction/data/parentAction.3.pngbin1583 -> 0 bytes
-rw-r--r--tests/auto/declarative/visual/animation/parentAction/data/parentAction.4.pngbin1640 -> 0 bytes
-rw-r--r--tests/auto/declarative/visual/animation/parentAction/data/parentAction.5.pngbin1640 -> 0 bytes
-rw-r--r--tests/auto/declarative/visual/animation/parentAction/data/parentAction.qml1207
-rw-r--r--tests/auto/declarative/visual/animation/parentAction/parentAction.qml55
-rw-r--r--tests/auto/moc/tst_moc.cpp51
-rw-r--r--tests/auto/qaccessibility/tst_qaccessibility.cpp3
-rw-r--r--tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp146
-rw-r--r--tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp136
-rw-r--r--tests/auto/qnetworkreply/tst_qnetworkreply.cpp58
-rw-r--r--tests/auto/qparallelanimationgroup/tst_qparallelanimationgroup.cpp17
-rw-r--r--tests/auto/qscriptclass/tst_qscriptclass.cpp118
-rw-r--r--tests/auto/qscriptengine/tst_qscriptengine.cpp31
-rw-r--r--tests/auto/qscriptvalue/tst_qscriptvalue.cpp8
38 files changed, 582 insertions, 1378 deletions
diff --git a/tests/auto/declarative/qdeclarativeanimations/tst_qdeclarativeanimations.cpp b/tests/auto/declarative/qdeclarativeanimations/tst_qdeclarativeanimations.cpp
index 076afea..bce7166 100644
--- a/tests/auto/declarative/qdeclarativeanimations/tst_qdeclarativeanimations.cpp
+++ b/tests/auto/declarative/qdeclarativeanimations/tst_qdeclarativeanimations.cpp
@@ -180,7 +180,7 @@ void tst_qdeclarativeanimations::simpleRotation()
QVERIFY(animation.target() == &rect);
QVERIFY(animation.property() == "rotation");
QVERIFY(animation.to() == 270);
- QVERIFY(animation.direction() == QDeclarativeRotationAnimation::Shortest);
+ QVERIFY(animation.direction() == QDeclarativeRotationAnimation::Numerical);
animation.start();
QVERIFY(animation.isRunning());
QTest::qWait(animation.duration());
@@ -193,7 +193,7 @@ void tst_qdeclarativeanimations::simpleRotation()
QVERIFY(animation.isPaused());
animation.setCurrentTime(125);
QVERIFY(animation.currentTime() == 125);
- QCOMPARE(rect.rotation(), qreal(-45));
+ QCOMPARE(rect.rotation(), qreal(135));
}
void tst_qdeclarativeanimations::alwaysRunToEnd()
diff --git a/tests/auto/declarative/qdeclarativedom/data/importdir/Bar.qml b/tests/auto/declarative/qdeclarativedom/data/import/Bar.qml
index 2d1a4a3..2d1a4a3 100644
--- a/tests/auto/declarative/qdeclarativedom/data/importdir/Bar.qml
+++ b/tests/auto/declarative/qdeclarativedom/data/import/Bar.qml
diff --git a/tests/auto/declarative/qdeclarativedom/data/importlib/sublib/qmldir/Foo.qml b/tests/auto/declarative/qdeclarativedom/data/importlib/sublib/Foo.qml
index 2d1a4a3..2d1a4a3 100644
--- a/tests/auto/declarative/qdeclarativedom/data/importlib/sublib/qmldir/Foo.qml
+++ b/tests/auto/declarative/qdeclarativedom/data/importlib/sublib/Foo.qml
diff --git a/tests/auto/declarative/qdeclarativedom/data/importlib/sublib/qmldir b/tests/auto/declarative/qdeclarativedom/data/importlib/sublib/qmldir
new file mode 100644
index 0000000..5bdd17b
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativedom/data/importlib/sublib/qmldir
@@ -0,0 +1 @@
+Foo Foo.qml
diff --git a/tests/auto/declarative/qdeclarativedom/tst_qdeclarativedom.cpp b/tests/auto/declarative/qdeclarativedom/tst_qdeclarativedom.cpp
index 6cd0bdb..adea384 100644
--- a/tests/auto/declarative/qdeclarativedom/tst_qdeclarativedom.cpp
+++ b/tests/auto/declarative/qdeclarativedom/tst_qdeclarativedom.cpp
@@ -340,9 +340,8 @@ void tst_qdeclarativedom::loadImports()
"Item {}";
QDeclarativeEngine engine;
- engine.addImportPath(SRCDIR "/data");
QDeclarativeDomDocument document;
- QVERIFY(document.load(&engine, qml));
+ QVERIFY(document.load(&engine, qml, QUrl::fromLocalFile(SRCDIR "/data/dummy.qml")));
QCOMPARE(document.imports().size(), 5);
diff --git a/tests/auto/declarative/qdeclarativeinstruction/tst_qdeclarativeinstruction.cpp b/tests/auto/declarative/qdeclarativeinstruction/tst_qdeclarativeinstruction.cpp
index 5f6d9a4..c747bfc 100644
--- a/tests/auto/declarative/qdeclarativeinstruction/tst_qdeclarativeinstruction.cpp
+++ b/tests/auto/declarative/qdeclarativeinstruction/tst_qdeclarativeinstruction.cpp
@@ -507,8 +507,16 @@ void tst_qdeclarativeinstruction::dump()
{
QDeclarativeInstruction i;
+ i.line = 48;
+ i.type = QDeclarativeInstruction::StoreImportedScript;
+ i.storeScript.value = 2;
+ data->bytecode << i;
+ }
+
+ {
+ QDeclarativeInstruction i;
i.line = 50;
- i.type = (QDeclarativeInstruction::Type)(QDeclarativeInstruction::Defer + 1); // Non-existant
+ i.type = (QDeclarativeInstruction::Type)(1234); // Non-existant
data->bytecode << i;
}
@@ -564,7 +572,8 @@ void tst_qdeclarativeinstruction::dump()
<< "45\t\t47\tPOP_VALUE\t\t35\t8"
<< "46\t\t48\tDEFER\t\t\t7"
<< "47\t\tNA\tDEFER\t\t\t7"
- << "48\t\t50\tXXX UNKOWN INSTRUCTION\t47"
+ << "48\t\t48\tSTORE_IMPORTED_SCRIPT\t2"
+ << "49\t\t50\tXXX UNKOWN INSTRUCTION\t1234"
<< "-------------------------------------------------------------------------------";
messages = QStringList();
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/importNewerVersion.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/importNewerVersion.errors.txt
new file mode 100644
index 0000000..413f096
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/importNewerVersion.errors.txt
@@ -0,0 +1 @@
+1:1:module "Test" version 2.0 is not installed
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/importNewerVersion.qml b/tests/auto/declarative/qdeclarativelanguage/data/importNewerVersion.qml
new file mode 100644
index 0000000..c4a0d38
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/importNewerVersion.qml
@@ -0,0 +1,3 @@
+import Test 2.0
+
+MyTypeObject { }
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/importNonExist.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/importNonExist.errors.txt
new file mode 100644
index 0000000..1baf05c
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/importNonExist.errors.txt
@@ -0,0 +1 @@
+2:1:"will-not-be-found": no such directory
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/importNonExist.qml b/tests/auto/declarative/qdeclarativelanguage/data/importNonExist.qml
new file mode 100644
index 0000000..ec6aa2b
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelanguage/data/importNonExist.qml
@@ -0,0 +1,5 @@
+// imports...
+import "will-not-be-found"
+import Qt 4.6
+
+Rectangle { }
diff --git a/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp b/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp
index 9188d72..42426a2 100644
--- a/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp
+++ b/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp
@@ -264,6 +264,8 @@ void tst_qdeclarativelanguage::errors_data()
QTest::newRow("importNamespaceConflict") << "importNamespaceConflict.qml" << "importNamespaceConflict.errors.txt" << false;
QTest::newRow("importVersionMissing (builtin)") << "importVersionMissingBuiltIn.qml" << "importVersionMissingBuiltIn.errors.txt" << false;
QTest::newRow("importVersionMissing (installed)") << "importVersionMissingInstalled.qml" << "importVersionMissingInstalled.errors.txt" << false;
+ QTest::newRow("importNonExist (installed)") << "importNonExist.qml" << "importNonExist.errors.txt" << false;
+ QTest::newRow("importNewerVersion (installed)") << "importNewerVersion.qml" << "importNewerVersion.errors.txt" << false;
QTest::newRow("invalidImportID") << "invalidImportID.qml" << "invalidImportID.errors.txt" << false;
QTest::newRow("signal.1") << "signal.1.qml" << "signal.1.errors.txt" << false;
diff --git a/tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp b/tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp
index 7a10ad0..576fe21 100644
--- a/tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp
+++ b/tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp
@@ -290,8 +290,6 @@ void tst_QDeclarativeListModel::dynamic_worker_data()
void tst_QDeclarativeListModel::dynamic_worker()
{
- QSKIP("Skip, awaiting imminent fixes", SkipAll);
-
QFETCH(QString, script);
QFETCH(int, result);
QFETCH(QString, warning);
@@ -342,7 +340,6 @@ void tst_QDeclarativeListModel::dynamic_worker()
void tst_QDeclarativeListModel::convertNestedToFlat_fail()
{
- QSKIP("Skip, awaiting imminent fixes", SkipAll);
// If a model has nested data, it cannot be used at all from a worker script
QFETCH(QString, script);
@@ -390,8 +387,6 @@ void tst_QDeclarativeListModel::convertNestedToFlat_ok()
// If a model only has plain data, it can be modified from a worker script. However,
// once the model is used from a worker script, it no longer accepts nested data
- QSKIP("Skip, awaiting imminent fixes", SkipAll);
-
QFETCH(QString, script);
QDeclarativeListModel model;
diff --git a/tests/auto/declarative/qdeclarativeloader/data/differentorigin.qml b/tests/auto/declarative/qdeclarativeloader/data/differentorigin.qml
new file mode 100644
index 0000000..e682d1c
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeloader/data/differentorigin.qml
@@ -0,0 +1,3 @@
+import Qt 4.6
+
+Loader { source: "http://evil.place/evil.qml" }
diff --git a/tests/auto/declarative/qdeclarativeloader/data/sameorigin-load.qml b/tests/auto/declarative/qdeclarativeloader/data/sameorigin-load.qml
new file mode 100644
index 0000000..e281246
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeloader/data/sameorigin-load.qml
@@ -0,0 +1,3 @@
+import Qt 4.6
+
+Item { }
diff --git a/tests/auto/declarative/qdeclarativeloader/data/sameorigin.qml b/tests/auto/declarative/qdeclarativeloader/data/sameorigin.qml
new file mode 100644
index 0000000..e7f5a14
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeloader/data/sameorigin.qml
@@ -0,0 +1,3 @@
+import Qt 4.6
+
+Loader { source: "sameorigin-load.qml" }
diff --git a/tests/auto/declarative/qdeclarativeloader/tst_qdeclarativeloader.cpp b/tests/auto/declarative/qdeclarativeloader/tst_qdeclarativeloader.cpp
index 2c20836..0deac3a 100644
--- a/tests/auto/declarative/qdeclarativeloader/tst_qdeclarativeloader.cpp
+++ b/tests/auto/declarative/qdeclarativeloader/tst_qdeclarativeloader.cpp
@@ -86,6 +86,8 @@ private slots:
void noResizeGraphicsWidget();
void networkRequestUrl();
void failNetworkRequest();
+ void networkSafety();
+ void networkSafety_data();
// void networkComponent();
void deleteComponentCrash();
@@ -394,7 +396,7 @@ void tst_QDeclarativeLoader::networkRequestUrl()
server.serveDirectory(SRCDIR "/data");
QDeclarativeComponent component(&engine);
- component.setData(QByteArray("import Qt 4.6\nLoader { source: \"http://127.0.0.1:14445/Rect120x60.qml\" }"), TEST_FILE(""));
+ component.setData(QByteArray("import Qt 4.6\nLoader { source: \"http://127.0.0.1:14445/Rect120x60.qml\" }"), QUrl("http://127.0.0.1:14445/dummy.qml"));
QDeclarativeLoader *loader = qobject_cast<QDeclarativeLoader*>(component.create());
QVERIFY(loader != 0);
@@ -448,7 +450,7 @@ void tst_QDeclarativeLoader::failNetworkRequest()
QTest::ignoreMessage(QtWarningMsg, "(:-1: Network error for URL http://127.0.0.1:14445/IDontExist.qml) ");
QDeclarativeComponent component(&engine);
- component.setData(QByteArray("import Qt 4.6\nLoader { source: \"http://127.0.0.1:14445/IDontExist.qml\" }"), TEST_FILE(""));
+ component.setData(QByteArray("import Qt 4.6\nLoader { source: \"http://127.0.0.1:14445/IDontExist.qml\" }"), QUrl("http://127.0.0.1:14445/dummy.qml"));
QDeclarativeLoader *loader = qobject_cast<QDeclarativeLoader*>(component.create());
QVERIFY(loader != 0);
@@ -483,6 +485,41 @@ void tst_QDeclarativeLoader::deleteComponentCrash()
delete item;
}
+void tst_QDeclarativeLoader::networkSafety_data()
+{
+ QTest::addColumn<QUrl>("url");
+ QTest::addColumn<QString>("message");
+
+ QTest::newRow("same origin") << QUrl("http://127.0.0.1:14445/sameorigin.qml") << QString();
+ QTest::newRow("different origin") << QUrl("http://127.0.0.1:14445/differentorigin.qml") << QString(" QUrl( \"http://evil.place/evil.qml\" ) is not a safe origin from QUrl( \"http://127.0.0.1:14445/differentorigin.qml\" ) ");
+}
+
+void tst_QDeclarativeLoader::networkSafety()
+{
+ TestHTTPServer server(SERVER_PORT);
+ QVERIFY(server.isValid());
+ server.serveDirectory(SRCDIR "/data");
+
+ QFETCH(QUrl, url);
+ QFETCH(QString, message);
+
+ if (!message.isEmpty())
+ QTest::ignoreMessage(QtWarningMsg, message.toLatin1());
+
+ QDeclarativeComponent component(&engine, url);
+ TRY_WAIT(component.status() == QDeclarativeComponent::Ready);
+ QDeclarativeLoader *loader = qobject_cast<QDeclarativeLoader*>(component.create());
+ QVERIFY(loader != 0);
+
+ if (message.isEmpty()) {
+ TRY_WAIT(loader->status() == QDeclarativeLoader::Ready);
+ } else {
+ TRY_WAIT(loader->status() == QDeclarativeLoader::Null);
+ }
+
+ delete loader;
+}
+
QTEST_MAIN(tst_QDeclarativeLoader)
#include "tst_qdeclarativeloader.moc"
diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/plugin.qml b/tests/auto/declarative/qdeclarativemoduleplugin/data/works.qml
index f29ae24..f29ae24 100644
--- a/tests/auto/declarative/qdeclarativemoduleplugin/plugin.qml
+++ b/tests/auto/declarative/qdeclarativemoduleplugin/data/works.qml
diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/com/nokia/AutoTestQmlPluginType/qmldir b/tests/auto/declarative/qdeclarativemoduleplugin/imports/com/nokia/AutoTestQmlPluginType/qmldir
index 0a8b5d4..0a8b5d4 100644
--- a/tests/auto/declarative/qdeclarativemoduleplugin/com/nokia/AutoTestQmlPluginType/qmldir
+++ b/tests/auto/declarative/qdeclarativemoduleplugin/imports/com/nokia/AutoTestQmlPluginType/qmldir
diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/plugin/plugin.pro b/tests/auto/declarative/qdeclarativemoduleplugin/plugin/plugin.pro
index 035cb7d..fc77225 100644
--- a/tests/auto/declarative/qdeclarativemoduleplugin/plugin/plugin.pro
+++ b/tests/auto/declarative/qdeclarativemoduleplugin/plugin/plugin.pro
@@ -2,5 +2,5 @@ TEMPLATE = lib
CONFIG += plugin
SOURCES = plugin.cpp
QT = core declarative
-DESTDIR = ../com/nokia/AutoTestQmlPluginType
+DESTDIR = ../imports/com/nokia/AutoTestQmlPluginType
diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/tst_qdeclarativemoduleplugin.cpp b/tests/auto/declarative/qdeclarativemoduleplugin/tst_qdeclarativemoduleplugin.cpp
index 1335c7c..26199d3 100644
--- a/tests/auto/declarative/qdeclarativemoduleplugin/tst_qdeclarativemoduleplugin.cpp
+++ b/tests/auto/declarative/qdeclarativemoduleplugin/tst_qdeclarativemoduleplugin.cpp
@@ -48,8 +48,8 @@ class tst_qdeclarativemoduleplugin : public QObject
{
Q_OBJECT
public:
- tst_qdeclarativemoduleplugin() {
- QCoreApplication::addLibraryPath(QLatin1String(SRCDIR) + QDir::separator() + QLatin1String("plugin"));
+ tst_qdeclarativemoduleplugin()
+ {
}
private slots:
@@ -103,9 +103,10 @@ void tst_qdeclarativemoduleplugin::importsPlugin()
{
QSKIP("Fix me", SkipAll);
QDeclarativeEngine engine;
+ engine.addImportPath(QLatin1String(SRCDIR) + QDir::separator() + QLatin1String("imports"));
QTest::ignoreMessage(QtWarningMsg, "plugin created");
QTest::ignoreMessage(QtWarningMsg, "import worked");
- QDeclarativeComponent component(&engine, TEST_FILE("plugin.qml"));
+ QDeclarativeComponent component(&engine, TEST_FILE("data/works.qml"));
foreach (QDeclarativeError err, component.errors())
qWarning() << err;
VERIFY_ERRORS(0);
diff --git a/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp b/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp
index 8b513e8..e623df6 100644
--- a/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp
+++ b/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp
@@ -72,6 +72,7 @@ private slots:
void readOnly();
void sendRequestSoftwareInputPanelEvent();
+ void setHAlignClearCache();
private:
void simulateKey(QDeclarativeView *, int key);
@@ -651,6 +652,38 @@ void tst_qdeclarativetextinput::sendRequestSoftwareInputPanelEvent()
QCOMPARE(ic.softwareInputPanelEventReceived, true);
}
+class MyTextInput : public QDeclarativeTextInput
+{
+public:
+ MyTextInput(QDeclarativeItem *parent = 0) : QDeclarativeTextInput(parent)
+ {
+ nbPaint = 0;
+ }
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
+ {
+ nbPaint++;
+ QDeclarativeTextInput::paint(painter, option, widget);
+ }
+ int nbPaint;
+};
+
+void tst_qdeclarativetextinput::setHAlignClearCache()
+{
+ QGraphicsScene scene;
+ QGraphicsView view(&scene);
+ MyTextInput input;
+ input.setText("Hello world");
+ scene.addItem(&input);
+ view.show();
+ QApplication::setActiveWindow(&view);
+ QTest::qWaitForWindowShown(&view);
+ QCOMPARE(input.nbPaint, 1);
+ input.setHAlign(QDeclarativeTextInput::AlignRight);
+ QApplication::processEvents();
+ //Changing the alignment should trigger a repaint
+ QCOMPARE(input.nbPaint, 2);
+}
+
QTEST_MAIN(tst_qdeclarativetextinput)
#include "tst_qdeclarativetextinput.moc"
diff --git a/tests/auto/declarative/visual/animation/parentAction/data/parentAction.0.png b/tests/auto/declarative/visual/animation/parentAction/data/parentAction.0.png
deleted file mode 100644
index a0032f8..0000000
--- a/tests/auto/declarative/visual/animation/parentAction/data/parentAction.0.png
+++ /dev/null
Binary files differ
diff --git a/tests/auto/declarative/visual/animation/parentAction/data/parentAction.1.png b/tests/auto/declarative/visual/animation/parentAction/data/parentAction.1.png
deleted file mode 100644
index 958b6af..0000000
--- a/tests/auto/declarative/visual/animation/parentAction/data/parentAction.1.png
+++ /dev/null
Binary files differ
diff --git a/tests/auto/declarative/visual/animation/parentAction/data/parentAction.2.png b/tests/auto/declarative/visual/animation/parentAction/data/parentAction.2.png
deleted file mode 100644
index 3a1811f..0000000
--- a/tests/auto/declarative/visual/animation/parentAction/data/parentAction.2.png
+++ /dev/null
Binary files differ
diff --git a/tests/auto/declarative/visual/animation/parentAction/data/parentAction.3.png b/tests/auto/declarative/visual/animation/parentAction/data/parentAction.3.png
deleted file mode 100644
index 36064c2..0000000
--- a/tests/auto/declarative/visual/animation/parentAction/data/parentAction.3.png
+++ /dev/null
Binary files differ
diff --git a/tests/auto/declarative/visual/animation/parentAction/data/parentAction.4.png b/tests/auto/declarative/visual/animation/parentAction/data/parentAction.4.png
deleted file mode 100644
index c493a1d..0000000
--- a/tests/auto/declarative/visual/animation/parentAction/data/parentAction.4.png
+++ /dev/null
Binary files differ
diff --git a/tests/auto/declarative/visual/animation/parentAction/data/parentAction.5.png b/tests/auto/declarative/visual/animation/parentAction/data/parentAction.5.png
deleted file mode 100644
index c493a1d..0000000
--- a/tests/auto/declarative/visual/animation/parentAction/data/parentAction.5.png
+++ /dev/null
Binary files differ
diff --git a/tests/auto/declarative/visual/animation/parentAction/data/parentAction.qml b/tests/auto/declarative/visual/animation/parentAction/data/parentAction.qml
deleted file mode 100644
index de27af7..0000000
--- a/tests/auto/declarative/visual/animation/parentAction/data/parentAction.qml
+++ /dev/null
@@ -1,1207 +0,0 @@
-import Qt.VisualTest 4.6
-
-VisualTest {
- Frame {
- msec: 0
- }
- Frame {
- msec: 16
- hash: "23ce049cd7e715c28f5845fd1a1fc195"
- }
- Frame {
- msec: 32
- hash: "23ce049cd7e715c28f5845fd1a1fc195"
- }
- Frame {
- msec: 48
- hash: "23ce049cd7e715c28f5845fd1a1fc195"
- }
- Frame {
- msec: 64
- hash: "23ce049cd7e715c28f5845fd1a1fc195"
- }
- Frame {
- msec: 80
- hash: "23ce049cd7e715c28f5845fd1a1fc195"
- }
- Frame {
- msec: 96
- hash: "23ce049cd7e715c28f5845fd1a1fc195"
- }
- Frame {
- msec: 112
- hash: "23ce049cd7e715c28f5845fd1a1fc195"
- }
- Frame {
- msec: 128
- hash: "23ce049cd7e715c28f5845fd1a1fc195"
- }
- Frame {
- msec: 144
- hash: "23ce049cd7e715c28f5845fd1a1fc195"
- }
- Frame {
- msec: 160
- hash: "23ce049cd7e715c28f5845fd1a1fc195"
- }
- Frame {
- msec: 176
- hash: "23ce049cd7e715c28f5845fd1a1fc195"
- }
- Frame {
- msec: 192
- hash: "23ce049cd7e715c28f5845fd1a1fc195"
- }
- Frame {
- msec: 208
- hash: "23ce049cd7e715c28f5845fd1a1fc195"
- }
- Frame {
- msec: 224
- hash: "23ce049cd7e715c28f5845fd1a1fc195"
- }
- Frame {
- msec: 240
- hash: "23ce049cd7e715c28f5845fd1a1fc195"
- }
- Frame {
- msec: 256
- hash: "23ce049cd7e715c28f5845fd1a1fc195"
- }
- Frame {
- msec: 272
- hash: "23ce049cd7e715c28f5845fd1a1fc195"
- }
- Frame {
- msec: 288
- hash: "23ce049cd7e715c28f5845fd1a1fc195"
- }
- Frame {
- msec: 304
- hash: "23ce049cd7e715c28f5845fd1a1fc195"
- }
- Frame {
- msec: 320
- hash: "23ce049cd7e715c28f5845fd1a1fc195"
- }
- Frame {
- msec: 336
- hash: "23ce049cd7e715c28f5845fd1a1fc195"
- }
- Frame {
- msec: 352
- hash: "23ce049cd7e715c28f5845fd1a1fc195"
- }
- Frame {
- msec: 368
- hash: "23ce049cd7e715c28f5845fd1a1fc195"
- }
- Frame {
- msec: 384
- hash: "23ce049cd7e715c28f5845fd1a1fc195"
- }
- Frame {
- msec: 400
- hash: "23ce049cd7e715c28f5845fd1a1fc195"
- }
- Frame {
- msec: 416
- hash: "23ce049cd7e715c28f5845fd1a1fc195"
- }
- Frame {
- msec: 432
- hash: "23ce049cd7e715c28f5845fd1a1fc195"
- }
- Frame {
- msec: 448
- hash: "23ce049cd7e715c28f5845fd1a1fc195"
- }
- Frame {
- msec: 464
- hash: "23ce049cd7e715c28f5845fd1a1fc195"
- }
- Frame {
- msec: 480
- hash: "23ce049cd7e715c28f5845fd1a1fc195"
- }
- Frame {
- msec: 496
- hash: "23ce049cd7e715c28f5845fd1a1fc195"
- }
- Frame {
- msec: 512
- hash: "23ce049cd7e715c28f5845fd1a1fc195"
- }
- Frame {
- msec: 528
- hash: "23ce049cd7e715c28f5845fd1a1fc195"
- }
- Frame {
- msec: 544
- hash: "23ce049cd7e715c28f5845fd1a1fc195"
- }
- Frame {
- msec: 560
- hash: "23ce049cd7e715c28f5845fd1a1fc195"
- }
- Frame {
- msec: 576
- hash: "23ce049cd7e715c28f5845fd1a1fc195"
- }
- Mouse {
- type: 2
- button: 1
- buttons: 1
- x: 150; y: 274
- modifiers: 0
- sendToViewport: true
- }
- Frame {
- msec: 592
- hash: "23ce049cd7e715c28f5845fd1a1fc195"
- }
- Frame {
- msec: 608
- hash: "a7bb3d44c8bcf403906afa86f5bc3062"
- }
- Frame {
- msec: 624
- hash: "2b366e6009e70fa0227a1fee662fe1bf"
- }
- Frame {
- msec: 640
- hash: "c12869fb8002aa36c3bfad7fd0979240"
- }
- Frame {
- msec: 656
- hash: "56c583e77b5e0a8707e977dc937c2acf"
- }
- Frame {
- msec: 672
- hash: "6b191d57a45a3f2d010a7f44064e409a"
- }
- Frame {
- msec: 688
- hash: "9457ee33c999a63fa4bd4db5c3ceac8b"
- }
- Frame {
- msec: 704
- hash: "446b23b662640ad6ad8c456f956fe73a"
- }
- Frame {
- msec: 720
- hash: "23c59708069406486e4979c7d59f3f4a"
- }
- Frame {
- msec: 736
- hash: "c9ce43ddca79b5b6f26af2c2259dc071"
- }
- Frame {
- msec: 752
- hash: "e838229ba70c30112918f19bb471fa34"
- }
- Frame {
- msec: 768
- hash: "0cbaeddb2ff6408a37a68fc685e2bca0"
- }
- Frame {
- msec: 784
- hash: "616b4ec719586b151ba3d709e51038bf"
- }
- Frame {
- msec: 800
- hash: "89b2c709f5c3083c204a9450e605c1d4"
- }
- Frame {
- msec: 816
- hash: "427a5c2d13631d899ff2d673e762f114"
- }
- Frame {
- msec: 832
- hash: "958aa9ca5a6b91aa6dfbc2a1ae3e2deb"
- }
- Frame {
- msec: 848
- hash: "09a3ac0010ed8f3df2cfa7ed9d0a92e4"
- }
- Frame {
- msec: 864
- hash: "5607ea54f9990f3232d6f56080e1ef15"
- }
- Frame {
- msec: 880
- hash: "600682467c55288b9d5e65299637dd72"
- }
- Frame {
- msec: 896
- hash: "bc7a238611574a13650f854ceac35032"
- }
- Frame {
- msec: 912
- hash: "e5f6b19b3685a96d4d0c3b8384513643"
- }
- Frame {
- msec: 928
- hash: "d5d23b0fc09136fd1ae121e311866cc3"
- }
- Frame {
- msec: 944
- hash: "5099e5edd1a6bd37f5f6c836a6ca7644"
- }
- Frame {
- msec: 960
- image: "parentAction.0.png"
- }
- Frame {
- msec: 976
- hash: "97dd20f7774cfd8379e1d1b44f8ddc7b"
- }
- Frame {
- msec: 992
- hash: "ab2deea9e4f8c43ed58b5a355800ecda"
- }
- Frame {
- msec: 1008
- hash: "88ec383ce368259d3cc18612b6f5b941"
- }
- Frame {
- msec: 1024
- hash: "f84b20b849a77e50717f99b9d844240e"
- }
- Frame {
- msec: 1040
- hash: "6c042360c2d24ad56cec32d01ce82d6b"
- }
- Frame {
- msec: 1056
- hash: "c86b464720192f3e039fa5d8ab5f09bb"
- }
- Frame {
- msec: 1072
- hash: "35ec432fdf91fcd1dfcd945cfe785b09"
- }
- Frame {
- msec: 1088
- hash: "27a2ec28e4fef006622e8211fd709853"
- }
- Frame {
- msec: 1104
- hash: "8454d1f5ed89551e2a403c869885116a"
- }
- Frame {
- msec: 1120
- hash: "7e33aed53dc4338c168274d972c8e711"
- }
- Frame {
- msec: 1136
- hash: "e0192ea2049d6bae6012f00406630a92"
- }
- Frame {
- msec: 1152
- hash: "a2ea5489a373084169024035a0f69e71"
- }
- Frame {
- msec: 1168
- hash: "6947a72c4d959b90dafdaddcac815b3e"
- }
- Frame {
- msec: 1184
- hash: "0e22cc3c96d0934095b7254f0f28b18b"
- }
- Frame {
- msec: 1200
- hash: "72529ddc6f2678a783aedf445d7038a4"
- }
- Frame {
- msec: 1216
- hash: "38f03c0ee50488ffd23a2fb3d3445461"
- }
- Frame {
- msec: 1232
- hash: "b441721ed30c787874a2a71a94e1ba44"
- }
- Frame {
- msec: 1248
- hash: "1e37f26d78590414b2ef01c72ad136a9"
- }
- Frame {
- msec: 1264
- hash: "88e4af80d068485ebd8c3d51f9bbfe8d"
- }
- Frame {
- msec: 1280
- hash: "107707216c16c629d8409cf006f9f2dc"
- }
- Frame {
- msec: 1296
- hash: "f56f3f4f140ac072f7df47eddfc76844"
- }
- Frame {
- msec: 1312
- hash: "41239a9d8ed793c24967875aabeae8a5"
- }
- Frame {
- msec: 1328
- hash: "30035e37320dae4f9ead01a30895eb38"
- }
- Frame {
- msec: 1344
- hash: "fb2f535b42b862b65f8adb3ad1a46779"
- }
- Frame {
- msec: 1360
- hash: "e10ba7f74d52fc963e20a4647ff0d620"
- }
- Frame {
- msec: 1376
- hash: "5abf5388566bed2fdb71afc8cd7cfe9b"
- }
- Frame {
- msec: 1392
- hash: "91990471563e3c8292e8e8325a1d17a2"
- }
- Frame {
- msec: 1408
- hash: "59a6293a48f83a9197adcffed3f32f15"
- }
- Frame {
- msec: 1424
- hash: "db3e75df318e9f0d239ce9b76e92eff3"
- }
- Frame {
- msec: 1440
- hash: "3b5c64bc64a701edb5c2e40b23443bc3"
- }
- Frame {
- msec: 1456
- hash: "9db08c0375148b2317427591b5f43608"
- }
- Frame {
- msec: 1472
- hash: "2d761f1530846eff87a7625a120e0afd"
- }
- Frame {
- msec: 1488
- hash: "c5460f8c58b83c2ac15842ddb023ad4f"
- }
- Frame {
- msec: 1504
- hash: "0efb51810a2dc359c7964268c98ea8eb"
- }
- Frame {
- msec: 1520
- hash: "b92a42012df57eb261badf1f518b8e67"
- }
- Frame {
- msec: 1536
- hash: "8d348bae62af2d35bdfee806a1c39910"
- }
- Frame {
- msec: 1552
- hash: "762d9bb4ed11d249bfd902a541129d60"
- }
- Frame {
- msec: 1568
- hash: "bddbd9f64a9f7156984feccd5fa94093"
- }
- Frame {
- msec: 1584
- hash: "353a98e1573b0518941ff22bf2776244"
- }
- Frame {
- msec: 1600
- hash: "1765aed97e29f25dee93a77a06557b82"
- }
- Frame {
- msec: 1616
- hash: "73b5c2bdb7f268f7a33e129c8ba44013"
- }
- Frame {
- msec: 1632
- hash: "46ac1976fb9932d0ef6e0b5927386ad9"
- }
- Frame {
- msec: 1648
- hash: "90b5b5b46c9c352e8be41cc74f96133a"
- }
- Frame {
- msec: 1664
- hash: "0efe0036577c890fd45cd7dd53014616"
- }
- Frame {
- msec: 1680
- hash: "7f32df17481abf40ccb33afe6d17085d"
- }
- Frame {
- msec: 1696
- hash: "1fa8544c48a476764f4f8278c14b651d"
- }
- Frame {
- msec: 1712
- hash: "f8f06ece30f690deeba5999ce63bf40b"
- }
- Frame {
- msec: 1728
- hash: "885b230f4b2fe380c7cf68955940d206"
- }
- Frame {
- msec: 1744
- hash: "d0fc5aa4df46099bb46a1d7db30baa09"
- }
- Frame {
- msec: 1760
- hash: "8fa7fe5197cbe1ff67f8a2c47f1f0740"
- }
- Frame {
- msec: 1776
- hash: "aa3b3b03460daf54f085551e1a46c08b"
- }
- Frame {
- msec: 1792
- hash: "35a1728a2430027a9474fb7d61090643"
- }
- Frame {
- msec: 1808
- hash: "2b1cff3986b8b03f1061176a4722b0f9"
- }
- Frame {
- msec: 1824
- hash: "8047be1b35ee3d5078a68c6cdc35eeb7"
- }
- Frame {
- msec: 1840
- hash: "7f7afa48bb7d612b354c8488e72c8339"
- }
- Frame {
- msec: 1856
- hash: "691a876caefce9aa0f5140c17059b8f4"
- }
- Frame {
- msec: 1872
- hash: "903bec66e47db766dc431f060726988c"
- }
- Frame {
- msec: 1888
- hash: "f13593fc891f0b050c01b61963019da1"
- }
- Frame {
- msec: 1904
- hash: "aa00de965bdb370a5974b195c3fb38af"
- }
- Frame {
- msec: 1920
- image: "parentAction.1.png"
- }
- Frame {
- msec: 1936
- hash: "168d3e27261c0943e6262b6be27adfb0"
- }
- Frame {
- msec: 1952
- hash: "6fafebd0b396e7c0a78c767c6af936ba"
- }
- Frame {
- msec: 1968
- hash: "827e3a3fcd6fd8588e9fcc043769b3a8"
- }
- Frame {
- msec: 1984
- hash: "155329bf1c1a6f6c37bf7e6e8a92c59b"
- }
- Frame {
- msec: 2000
- hash: "d3008d1e7cee5170171699ef6fb9aa81"
- }
- Frame {
- msec: 2016
- hash: "5c1244e7806e131a6063f22a66e4eb12"
- }
- Frame {
- msec: 2032
- hash: "fcd6b372229a6cf14face81e9d614456"
- }
- Frame {
- msec: 2048
- hash: "bf1a375a81bf43c5671cccc62e9a0462"
- }
- Frame {
- msec: 2064
- hash: "0e22404508470baaa6621f37361951fa"
- }
- Frame {
- msec: 2080
- hash: "45046f28c103caa161e41861f71731c4"
- }
- Frame {
- msec: 2096
- hash: "7a92731c713470a2b2c91fd6b83447de"
- }
- Frame {
- msec: 2112
- hash: "7a92731c713470a2b2c91fd6b83447de"
- }
- Frame {
- msec: 2128
- hash: "7a92731c713470a2b2c91fd6b83447de"
- }
- Frame {
- msec: 2144
- hash: "7a92731c713470a2b2c91fd6b83447de"
- }
- Frame {
- msec: 2160
- hash: "7a92731c713470a2b2c91fd6b83447de"
- }
- Frame {
- msec: 2176
- hash: "7a92731c713470a2b2c91fd6b83447de"
- }
- Frame {
- msec: 2192
- hash: "7a92731c713470a2b2c91fd6b83447de"
- }
- Frame {
- msec: 2208
- hash: "7a92731c713470a2b2c91fd6b83447de"
- }
- Frame {
- msec: 2224
- hash: "7a92731c713470a2b2c91fd6b83447de"
- }
- Frame {
- msec: 2240
- hash: "7a92731c713470a2b2c91fd6b83447de"
- }
- Frame {
- msec: 2256
- hash: "7a92731c713470a2b2c91fd6b83447de"
- }
- Frame {
- msec: 2272
- hash: "7a92731c713470a2b2c91fd6b83447de"
- }
- Frame {
- msec: 2288
- hash: "7a92731c713470a2b2c91fd6b83447de"
- }
- Frame {
- msec: 2304
- hash: "7a92731c713470a2b2c91fd6b83447de"
- }
- Frame {
- msec: 2320
- hash: "7a92731c713470a2b2c91fd6b83447de"
- }
- Frame {
- msec: 2336
- hash: "7a92731c713470a2b2c91fd6b83447de"
- }
- Frame {
- msec: 2352
- hash: "7a92731c713470a2b2c91fd6b83447de"
- }
- Frame {
- msec: 2368
- hash: "7a92731c713470a2b2c91fd6b83447de"
- }
- Frame {
- msec: 2384
- hash: "7a92731c713470a2b2c91fd6b83447de"
- }
- Frame {
- msec: 2400
- hash: "7a92731c713470a2b2c91fd6b83447de"
- }
- Frame {
- msec: 2416
- hash: "7a92731c713470a2b2c91fd6b83447de"
- }
- Frame {
- msec: 2432
- hash: "7a92731c713470a2b2c91fd6b83447de"
- }
- Frame {
- msec: 2448
- hash: "7a92731c713470a2b2c91fd6b83447de"
- }
- Frame {
- msec: 2464
- hash: "7a92731c713470a2b2c91fd6b83447de"
- }
- Frame {
- msec: 2480
- hash: "7a92731c713470a2b2c91fd6b83447de"
- }
- Frame {
- msec: 2496
- hash: "7a92731c713470a2b2c91fd6b83447de"
- }
- Frame {
- msec: 2512
- hash: "7a92731c713470a2b2c91fd6b83447de"
- }
- Frame {
- msec: 2528
- hash: "7a92731c713470a2b2c91fd6b83447de"
- }
- Frame {
- msec: 2544
- hash: "7a92731c713470a2b2c91fd6b83447de"
- }
- Frame {
- msec: 2560
- hash: "7a92731c713470a2b2c91fd6b83447de"
- }
- Frame {
- msec: 2576
- hash: "7a92731c713470a2b2c91fd6b83447de"
- }
- Frame {
- msec: 2592
- hash: "7a92731c713470a2b2c91fd6b83447de"
- }
- Frame {
- msec: 2608
- hash: "7a92731c713470a2b2c91fd6b83447de"
- }
- Frame {
- msec: 2624
- hash: "7a92731c713470a2b2c91fd6b83447de"
- }
- Frame {
- msec: 2640
- hash: "7a92731c713470a2b2c91fd6b83447de"
- }
- Frame {
- msec: 2656
- hash: "7a92731c713470a2b2c91fd6b83447de"
- }
- Frame {
- msec: 2672
- hash: "7a92731c713470a2b2c91fd6b83447de"
- }
- Frame {
- msec: 2688
- hash: "7a92731c713470a2b2c91fd6b83447de"
- }
- Frame {
- msec: 2704
- hash: "7a92731c713470a2b2c91fd6b83447de"
- }
- Frame {
- msec: 2720
- hash: "7a92731c713470a2b2c91fd6b83447de"
- }
- Frame {
- msec: 2736
- hash: "7a92731c713470a2b2c91fd6b83447de"
- }
- Frame {
- msec: 2752
- hash: "7a92731c713470a2b2c91fd6b83447de"
- }
- Mouse {
- type: 3
- button: 1
- buttons: 0
- x: 150; y: 274
- modifiers: 0
- sendToViewport: true
- }
- Frame {
- msec: 2768
- hash: "7a92731c713470a2b2c91fd6b83447de"
- }
- Frame {
- msec: 2784
- hash: "44a0b46c21bd4c76d44883ba146e3614"
- }
- Frame {
- msec: 2800
- hash: "2224abc3333a2bc5fa1cf3c4e8d6a6f9"
- }
- Frame {
- msec: 2816
- hash: "ea9c05c0295a300e21aacbdfd5b4968e"
- }
- Frame {
- msec: 2832
- hash: "e630e2893f89a6ae536bcbd1a084af07"
- }
- Frame {
- msec: 2848
- hash: "af56f1e79eb3746efb9e4bcbc3fbced8"
- }
- Frame {
- msec: 2864
- hash: "96be8c3ba0d7a85c6f6df877b869b563"
- }
- Frame {
- msec: 2880
- image: "parentAction.2.png"
- }
- Frame {
- msec: 2896
- hash: "603d8684cb6f097e3ab2a2e5ef053112"
- }
- Frame {
- msec: 2912
- hash: "0433d242d1dd40a3792f55f807ebbff4"
- }
- Frame {
- msec: 2928
- hash: "1190067cacc7361f6cfe09f153c7a07e"
- }
- Frame {
- msec: 2944
- hash: "98e917880471511122847ad8a406e3a3"
- }
- Frame {
- msec: 2960
- hash: "fff06869074a3a6c5823ed3fb6fa7a43"
- }
- Frame {
- msec: 2976
- hash: "602d95daee8f160a0fd784931d0a06bd"
- }
- Frame {
- msec: 2992
- hash: "f7e466bbd52f40e88ff567758f4db835"
- }
- Frame {
- msec: 3008
- hash: "54417a4c4fb71d458439ad2e2126f8e1"
- }
- Frame {
- msec: 3024
- hash: "fe150dd5056b9dbf1cd0b196e9a7a47b"
- }
- Frame {
- msec: 3040
- hash: "1384c871bead85916f7bfcdebc370697"
- }
- Frame {
- msec: 3056
- hash: "5f13339cc0e604b75a9d1d85342fa717"
- }
- Frame {
- msec: 3072
- hash: "655069d61b7a44e729a2cbb33d683c3e"
- }
- Frame {
- msec: 3088
- hash: "2324e9e4a02e41855b066983dbf0e61d"
- }
- Frame {
- msec: 3104
- hash: "0217baf091325b95c033ba073bd68ce5"
- }
- Frame {
- msec: 3120
- hash: "c27854c3af5b58db85846a1762ab18ba"
- }
- Frame {
- msec: 3136
- hash: "45246ee6383ceb6260f84571a885ba90"
- }
- Frame {
- msec: 3152
- hash: "d82ded86f093d1a376994cacf43d0343"
- }
- Frame {
- msec: 3168
- hash: "c9179d30f80c6101bca2bed40d6a859f"
- }
- Frame {
- msec: 3184
- hash: "a63e032d20a9d985c6c345434d98a364"
- }
- Frame {
- msec: 3200
- hash: "fc7d6797ce15edf7fadb9dae691ecd5c"
- }
- Frame {
- msec: 3216
- hash: "76cf37ad8c50fed8b1900784b647819c"
- }
- Frame {
- msec: 3232
- hash: "256aab3690c9ba928bb4d4dd3bbfc756"
- }
- Frame {
- msec: 3248
- hash: "90cab52fdefbae4e7d0f0f93b46ebeb0"
- }
- Frame {
- msec: 3264
- hash: "badb5103bf826dc467f6e620cc2b47be"
- }
- Frame {
- msec: 3280
- hash: "e7d0e437de5ebc0fa07b2a4ef11159cb"
- }
- Frame {
- msec: 3296
- hash: "5931b1c3932ab91446324165d7e2603a"
- }
- Frame {
- msec: 3312
- hash: "ce1808db90ba955ab3cb845500f4c013"
- }
- Frame {
- msec: 3328
- hash: "142f8a440d1fe2d868f47ba3006de9d7"
- }
- Frame {
- msec: 3344
- hash: "10d32a6cc90319ea66d7f2c1241590ce"
- }
- Frame {
- msec: 3360
- hash: "7f633559d715396e6de451b3dd2fadbd"
- }
- Frame {
- msec: 3376
- hash: "d44590ae51ceef5e082747c44bc41be9"
- }
- Frame {
- msec: 3392
- hash: "2b498181668fb1fbf65294d575654929"
- }
- Frame {
- msec: 3408
- hash: "7efeeffd08e4de440da83511313de729"
- }
- Frame {
- msec: 3424
- hash: "8de2331393d1e712192d11ed096836d3"
- }
- Frame {
- msec: 3440
- hash: "fa9381ef2e295865a9b8cb9b36a0eacf"
- }
- Frame {
- msec: 3456
- hash: "97debc4432c5ecb7f606a81e5411b02c"
- }
- Frame {
- msec: 3472
- hash: "eb4c1bb1f4398e3c18182c28a015be76"
- }
- Frame {
- msec: 3488
- hash: "a976aa509f4c6f309d9a6011eeae02aa"
- }
- Frame {
- msec: 3504
- hash: "457de7ee05e0ef0ef120a3d4e371c02e"
- }
- Frame {
- msec: 3520
- hash: "0c01f9f150fe33155fa20703735a6d27"
- }
- Frame {
- msec: 3536
- hash: "5af4f80624082a264010247ea8630a1a"
- }
- Frame {
- msec: 3552
- hash: "b23a1191d149549fa29a61b6dc70f037"
- }
- Frame {
- msec: 3568
- hash: "e00fb32cb13b1347e4b7b9fdbcca68e5"
- }
- Frame {
- msec: 3584
- hash: "fef0503c82f253f8bc3fb3e705a98aa7"
- }
- Frame {
- msec: 3600
- hash: "7a9beca28340d2aa89da5e05f5ac2a55"
- }
- Frame {
- msec: 3616
- hash: "f3c57ea07ab486ffa1f46da60de0b8f1"
- }
- Frame {
- msec: 3632
- hash: "ef0a4ad9ac339fd6ea50dbe6baa9387f"
- }
- Frame {
- msec: 3648
- hash: "1b317a9eb4ce022f005d551546c688a4"
- }
- Frame {
- msec: 3664
- hash: "628e912a4a26800b9b7b5e60e60e3a7d"
- }
- Frame {
- msec: 3680
- hash: "3587b75e4d834a88729754d2c2a4b193"
- }
- Frame {
- msec: 3696
- hash: "084bc1360a38123589baec5aae15b4ff"
- }
- Frame {
- msec: 3712
- hash: "47f0f6c3cdf456826a6fd6846e58dcc8"
- }
- Frame {
- msec: 3728
- hash: "ed982c4c3ebd132baaaf43efad40a3f7"
- }
- Frame {
- msec: 3744
- hash: "d7ddce47c23fada4c69d53d934582d71"
- }
- Frame {
- msec: 3760
- hash: "74f2f911bee26c4c551f4c70596753ae"
- }
- Frame {
- msec: 3776
- hash: "3ed7cbf10dfce3a485d7878766cf9da6"
- }
- Frame {
- msec: 3792
- hash: "87a74257551ab6c7fcfe05e815482ae9"
- }
- Frame {
- msec: 3808
- hash: "4f63e4904e97d4ce832b20b7317a9958"
- }
- Frame {
- msec: 3824
- hash: "f912da8781e547c6e28890655c1b8884"
- }
- Frame {
- msec: 3840
- image: "parentAction.3.png"
- }
- Frame {
- msec: 3856
- hash: "faa640ccf993324400254ffb862ac279"
- }
- Frame {
- msec: 3872
- hash: "b67f342424d1b9a364b09da8994fcd6b"
- }
- Frame {
- msec: 3888
- hash: "b2407732194c1e0c2a9bfb379b94b562"
- }
- Frame {
- msec: 3904
- hash: "55733608d0302ef90c124322ac6d8dc6"
- }
- Frame {
- msec: 3920
- hash: "734f5b628a26d3d7c91ee84fb26d5b5f"
- }
- Frame {
- msec: 3936
- hash: "27839fefa4a218cd77843358392bb874"
- }
- Frame {
- msec: 3952
- hash: "8cac19559d37bd2b581cef0a4c707753"
- }
- Frame {
- msec: 3968
- hash: "91422870aa1471571e7dd8ff5103f76c"
- }
- Frame {
- msec: 3984
- hash: "7156166d5f8d13483467ef515627c95d"
- }
- Frame {
- msec: 4000
- hash: "6028e8374c2ce42a9a9e85b4a8b53027"
- }
- Frame {
- msec: 4016
- hash: "17c99592be58d2e03f9f173c47c0649b"
- }
- Frame {
- msec: 4032
- hash: "6084b53186c6a7eda38ac7fa34bf45ce"
- }
- Frame {
- msec: 4048
- hash: "e82131a8a5a06519f49308bbc25738cf"
- }
- Frame {
- msec: 4064
- hash: "77bdb69cbe55d9c503c6aa1c0f974d87"
- }
- Frame {
- msec: 4080
- hash: "b2346ec5d376651347281d5fb00fc4d7"
- }
- Frame {
- msec: 4096
- hash: "36a3b72c9d7f09795c546855a269801d"
- }
- Frame {
- msec: 4112
- hash: "4e5478b33baca797f3f8f72c2c6c51ad"
- }
- Frame {
- msec: 4128
- hash: "e59d12be3ed1f58de010d385ddfe78e5"
- }
- Frame {
- msec: 4144
- hash: "9674106a146effd47c2724a2dd82ae84"
- }
- Frame {
- msec: 4160
- hash: "862cec781f169f713032e6d52d3616ce"
- }
- Frame {
- msec: 4176
- hash: "c8d47bdfb6518ef4827677023313d559"
- }
- Frame {
- msec: 4192
- hash: "19413931b3e788067dfaef39b47d30ff"
- }
- Frame {
- msec: 4208
- hash: "600e426532c0348cd622257b0773efd5"
- }
- Frame {
- msec: 4224
- hash: "6d975e259d4efa108375d271451531c1"
- }
- Frame {
- msec: 4240
- hash: "50b0da4848564c063694202ce16ea808"
- }
- Frame {
- msec: 4256
- hash: "0a9450739031f680735b5210e6a30c3f"
- }
- Frame {
- msec: 4272
- hash: "23ce049cd7e715c28f5845fd1a1fc195"
- }
- Frame {
- msec: 4288
- hash: "23ce049cd7e715c28f5845fd1a1fc195"
- }
- Frame {
- msec: 4304
- hash: "23ce049cd7e715c28f5845fd1a1fc195"
- }
- Frame {
- msec: 4320
- hash: "23ce049cd7e715c28f5845fd1a1fc195"
- }
- Frame {
- msec: 4336
- hash: "23ce049cd7e715c28f5845fd1a1fc195"
- }
- Frame {
- msec: 4352
- hash: "23ce049cd7e715c28f5845fd1a1fc195"
- }
- Frame {
- msec: 4368
- hash: "23ce049cd7e715c28f5845fd1a1fc195"
- }
- Frame {
- msec: 4384
- hash: "23ce049cd7e715c28f5845fd1a1fc195"
- }
- Frame {
- msec: 4400
- hash: "23ce049cd7e715c28f5845fd1a1fc195"
- }
- Frame {
- msec: 4416
- hash: "23ce049cd7e715c28f5845fd1a1fc195"
- }
- Frame {
- msec: 4432
- hash: "23ce049cd7e715c28f5845fd1a1fc195"
- }
- Frame {
- msec: 4448
- hash: "23ce049cd7e715c28f5845fd1a1fc195"
- }
- Frame {
- msec: 4464
- hash: "23ce049cd7e715c28f5845fd1a1fc195"
- }
- Frame {
- msec: 4480
- hash: "23ce049cd7e715c28f5845fd1a1fc195"
- }
- Frame {
- msec: 4496
- hash: "23ce049cd7e715c28f5845fd1a1fc195"
- }
- Frame {
- msec: 4512
- hash: "23ce049cd7e715c28f5845fd1a1fc195"
- }
- Frame {
- msec: 4528
- hash: "23ce049cd7e715c28f5845fd1a1fc195"
- }
- Frame {
- msec: 4544
- hash: "23ce049cd7e715c28f5845fd1a1fc195"
- }
- Key {
- type: 6
- key: 16777249
- modifiers: 67108864
- text: ""
- autorep: false
- count: 1
- }
- Frame {
- msec: 4560
- hash: "23ce049cd7e715c28f5845fd1a1fc195"
- }
- Frame {
- msec: 4576
- hash: "23ce049cd7e715c28f5845fd1a1fc195"
- }
- Frame {
- msec: 4592
- hash: "23ce049cd7e715c28f5845fd1a1fc195"
- }
- Frame {
- msec: 4608
- hash: "23ce049cd7e715c28f5845fd1a1fc195"
- }
- Frame {
- msec: 4624
- hash: "23ce049cd7e715c28f5845fd1a1fc195"
- }
- Frame {
- msec: 4640
- hash: "23ce049cd7e715c28f5845fd1a1fc195"
- }
- Frame {
- msec: 4656
- hash: "23ce049cd7e715c28f5845fd1a1fc195"
- }
- Frame {
- msec: 4672
- hash: "23ce049cd7e715c28f5845fd1a1fc195"
- }
- Frame {
- msec: 4688
- hash: "23ce049cd7e715c28f5845fd1a1fc195"
- }
- Frame {
- msec: 4704
- hash: "23ce049cd7e715c28f5845fd1a1fc195"
- }
-}
diff --git a/tests/auto/declarative/visual/animation/parentAction/parentAction.qml b/tests/auto/declarative/visual/animation/parentAction/parentAction.qml
deleted file mode 100644
index eb3103e..0000000
--- a/tests/auto/declarative/visual/animation/parentAction/parentAction.qml
+++ /dev/null
@@ -1,55 +0,0 @@
-import Qt 4.6
-
-Rectangle {
- width: 400; height: 400
- Item {
- scale: .5
- rotation: 15
- transformOrigin: "Center"
- x: 10; y: 10
- Rectangle {
- id: myRect
- x: 5
- width: 100; height: 100
- transformOrigin: "BottomLeft"
- color: "red"
- }
- }
- MouseArea {
- id: clickable
- anchors.fill: parent
- }
-
- Item {
- x: 200; y: 200
- rotation: 52;
- scale: 2
- Item {
- id: newParent
- x: 100; y: 100
- }
- }
-
- states: State {
- name: "moved"
- when: clickable.pressed
- ParentChange {
- target: myRect
- parent: newParent
- }
- PropertyChanges {
- target: myRect
- rotation: -52
- scale: 1
- color: "blue"
- }
- }
-
- transitions: Transition {
- SequentialAnimation {
- ColorAnimation { duration: 500}
- ParentAction {}
- NumberAnimation { properties: "rotation, scale"; duration: 1000 }
- }
- }
-}
diff --git a/tests/auto/moc/tst_moc.cpp b/tests/auto/moc/tst_moc.cpp
index fad4845..30c2721 100644
--- a/tests/auto/moc/tst_moc.cpp
+++ b/tests/auto/moc/tst_moc.cpp
@@ -484,6 +484,7 @@ private slots:
void singleFunctionKeywordSignalAndSlot();
void templateGtGt();
void qprivateslots();
+ void qprivateproperties();
void inlineSlotsWithThrowDeclaration();
void warnOnPropertyWithoutREAD();
void constructors();
@@ -1071,6 +1072,56 @@ void tst_Moc::qprivateslots()
QVERIFY(mobj->indexOfMethod("method1()") != -1); //tast204730
}
+class PrivatePropertyTest : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(int foo READ foo WRITE setFoo);
+ Q_PRIVATE_PROPERTY(d, int bar READ bar WRITE setBar);
+ Q_PRIVATE_PROPERTY(PrivatePropertyTest::d, int plop READ plop WRITE setPlop);
+ Q_PRIVATE_PROPERTY(PrivatePropertyTest::d_func(), int baz READ baz WRITE setBaz);
+ class MyDPointer {
+ public:
+ MyDPointer() : mBar(0), mPlop(0) {}
+ int bar() { return mBar ; }
+ void setBar(int value) { mBar = value; }
+ int plop() { return mPlop ; }
+ void setPlop(int value) { mPlop = value; }
+ int baz() { return mBaz ; }
+ void setBaz(int value) { mBaz = value; }
+ private:
+ int mBar;
+ int mPlop;
+ int mBaz;
+ };
+public:
+ PrivatePropertyTest() : mFoo(0), d (new MyDPointer) {}
+ int foo() { return mFoo ; }
+ void setFoo(int value) { mFoo = value; }
+ MyDPointer *d_func() {return d;}
+private:
+ int mFoo;
+ MyDPointer *d;
+};
+
+
+void tst_Moc::qprivateproperties()
+{
+ PrivatePropertyTest test;
+
+ test.setProperty("foo", 1);
+ QCOMPARE(test.property("foo"), qVariantFromValue(1));
+
+ test.setProperty("bar", 2);
+ QCOMPARE(test.property("bar"), qVariantFromValue(2));
+
+ test.setProperty("plop", 3);
+ QCOMPARE(test.property("plop"), qVariantFromValue(3));
+
+ test.setProperty("baz", 4);
+ QCOMPARE(test.property("baz"), qVariantFromValue(4));
+
+}
+
#include "task189996.h"
void InlineSlotsWithThrowDeclaration::c() throw() {}
diff --git a/tests/auto/qaccessibility/tst_qaccessibility.cpp b/tests/auto/qaccessibility/tst_qaccessibility.cpp
index 133cb33..e5a332a 100644
--- a/tests/auto/qaccessibility/tst_qaccessibility.cpp
+++ b/tests/auto/qaccessibility/tst_qaccessibility.cpp
@@ -3923,9 +3923,8 @@ void tst_QAccessibility::comboBoxTest()
acc = QAccessible::queryAccessibleInterface(cb);
- QRect accRect = acc->rect(0);
for (int i = 1; i < acc->childCount(); ++i) {
- QVERIFY(accRect.contains(acc->rect(i)));
+ QTRY_VERIFY(acc->rect(0).contains(acc->rect(i)));
}
QCOMPARE(acc->doAction(QAccessible::Press, 2), true);
QTest::qWait(400);
diff --git a/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp b/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp
index d37ff76..a155222 100644
--- a/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp
+++ b/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp
@@ -284,6 +284,7 @@ private slots:
void task250680_childClip();
void taskQTBUG_5904_crashWithDeviceCoordinateCache();
void taskQT657_paintIntoCacheWithTransparentParts();
+ void taskQTBUG_7863_paintIntoCacheWithTransparentParts();
};
void tst_QGraphicsScene::initTestCase()
@@ -4349,12 +4350,14 @@ void tst_QGraphicsScene::taskQTBUG_5904_crashWithDeviceCoordinateCache()
void tst_QGraphicsScene::taskQT657_paintIntoCacheWithTransparentParts()
{
+ // Test using DeviceCoordinateCache and opaque item
QWidget *w = new QWidget();
- w->setPalette(Qt::blue);
+ w->setPalette(QColor(0, 0, 255));
w->setGeometry(0, 0, 50, 50);
QGraphicsScene *scene = new QGraphicsScene();
- QGraphicsView *view = new QGraphicsView(scene);
+ CustomView *view = new CustomView;
+ view->setScene(scene);
QGraphicsProxyWidget *proxy = scene->addWidget(w);
proxy->setCacheMode(QGraphicsItem::DeviceCoordinateCache);
@@ -4362,13 +4365,14 @@ void tst_QGraphicsScene::taskQT657_paintIntoCacheWithTransparentParts()
view->show();
QTest::qWaitForWindowShown(view);
- w->update(10,10,10,10);
+ view->repaints = 0;
+ proxy->update(10, 10, 10, 10);
QTest::qWait(50);
+ QTRY_VERIFY(view->repaints > 0);
QPixmap pix;
QGraphicsItemPrivate* itemp = QGraphicsItemPrivate::get(proxy);
- QPixmapCache::Key key = itemp->extraItemCache()->deviceData.value(view->viewport()).key;
- QVERIFY(QPixmapCache::find(key, &pix));
+ QTRY_VERIFY(QPixmapCache::find(itemp->extraItemCache()->deviceData.value(view->viewport()).key, &pix));
QTransform t = proxy->sceneTransform();
// Map from scene coordinates to pixmap coordinates.
@@ -4383,6 +4387,138 @@ void tst_QGraphicsScene::taskQT657_paintIntoCacheWithTransparentParts()
for(int j = 0; j < im.height(); j++)
QCOMPARE(qAlpha(im.pixel(i, j)), 255);
}
+
+ delete w;
+}
+
+void tst_QGraphicsScene::taskQTBUG_7863_paintIntoCacheWithTransparentParts()
+{
+ // Test using DeviceCoordinateCache and semi-transparent item
+ {
+ QGraphicsRectItem *backItem = new QGraphicsRectItem(0, 0, 100, 100);
+ backItem->setBrush(QColor(255, 255, 0));
+ QGraphicsRectItem *rectItem = new QGraphicsRectItem(0, 0, 50, 50);
+ rectItem->setBrush(QColor(0, 0, 255, 125));
+ rectItem->setParentItem(backItem);
+
+ QGraphicsScene *scene = new QGraphicsScene();
+ CustomView *view = new CustomView;
+ view->setScene(scene);
+
+ scene->addItem(backItem);
+ rectItem->setCacheMode(QGraphicsItem::DeviceCoordinateCache);
+ backItem->rotate(15);
+
+ view->show();
+ QTest::qWaitForWindowShown(view);
+ view->repaints = 0;
+ rectItem->update(10, 10, 10, 10);
+ QTest::qWait(50);
+ QTRY_VERIFY(view->repaints > 0);
+
+ QPixmap pix;
+ QGraphicsItemPrivate* itemp = QGraphicsItemPrivate::get(rectItem);
+ QTRY_VERIFY(QPixmapCache::find(itemp->extraItemCache()->deviceData.value(view->viewport()).key, &pix));
+
+ QTransform t = rectItem->sceneTransform();
+ // Map from scene coordinates to pixmap coordinates.
+ // X origin in the pixmap is the most-left point
+ // of the item's boundingRect in the scene.
+ qreal adjust = t.mapRect(rectItem->boundingRect().toRect()).left();
+ QRect rect = t.mapRect(QRect(10, 10, 10, 10)).adjusted(-adjust, 0, -adjust + 1, 1);
+ QPixmap subpix = pix.copy(rect);
+
+ QImage im = subpix.toImage();
+ for(int i = 0; i < im.width(); i++) {
+ for(int j = 0; j < im.height(); j++) {
+ QCOMPARE(qAlpha(im.pixel(i, j)), 125);
+ }
+ }
+
+ delete view;
+ }
+
+ // Test using ItemCoordinateCache and opaque item
+ {
+ QGraphicsRectItem *rectItem = new QGraphicsRectItem(0, 0, 50, 50);
+ rectItem->setBrush(QColor(0, 0, 255));
+
+ QGraphicsScene *scene = new QGraphicsScene();
+ CustomView *view = new CustomView;
+ view->setScene(scene);
+
+ scene->addItem(rectItem);
+ rectItem->setCacheMode(QGraphicsItem::ItemCoordinateCache);
+ rectItem->rotate(15);
+
+ view->show();
+ QTest::qWaitForWindowShown(view);
+ view->repaints = 0;
+ rectItem->update(10, 10, 10, 10);
+ QTest::qWait(50);
+ QTRY_VERIFY(view->repaints > 0);
+
+ QPixmap pix;
+ QGraphicsItemPrivate* itemp = QGraphicsItemPrivate::get(rectItem);
+ QTRY_VERIFY(QPixmapCache::find(itemp->extraItemCache()->key, &pix));
+
+ QTransform t = rectItem->sceneTransform();
+ // Map from scene coordinates to pixmap coordinates.
+ // X origin in the pixmap is the most-left point
+ // of the item's boundingRect in the scene.
+ qreal adjust = t.mapRect(rectItem->boundingRect().toRect()).left();
+ QRect rect = t.mapRect(QRect(10, 10, 10, 10)).adjusted(-adjust, 0, -adjust + 1, 1);
+ QPixmap subpix = pix.copy(rect);
+
+ QImage im = subpix.toImage();
+ for(int i = 0; i < im.width(); i++) {
+ for(int j = 0; j < im.height(); j++)
+ QCOMPARE(qAlpha(im.pixel(i, j)), 255);
+ }
+
+ delete view;
+ }
+
+ // Test using ItemCoordinateCache and semi-transparent item
+ {
+ QGraphicsRectItem *rectItem = new QGraphicsRectItem(0, 0, 50, 50);
+ rectItem->setBrush(QColor(0, 0, 255, 125));
+
+ QGraphicsScene *scene = new QGraphicsScene();
+ CustomView *view = new CustomView;
+ view->setScene(scene);
+
+ scene->addItem(rectItem);
+ rectItem->setCacheMode(QGraphicsItem::ItemCoordinateCache);
+ rectItem->rotate(15);
+
+ view->show();
+ QTest::qWaitForWindowShown(view);
+ view->repaints = 0;
+ rectItem->update(10, 10, 10, 10);
+ QTest::qWait(50);
+ QTRY_VERIFY(view->repaints > 0);
+
+ QPixmap pix;
+ QGraphicsItemPrivate* itemp = QGraphicsItemPrivate::get(rectItem);
+ QTRY_VERIFY(QPixmapCache::find(itemp->extraItemCache()->key, &pix));
+
+ QTransform t = rectItem->sceneTransform();
+ // Map from scene coordinates to pixmap coordinates.
+ // X origin in the pixmap is the most-left point
+ // of the item's boundingRect in the scene.
+ qreal adjust = t.mapRect(rectItem->boundingRect().toRect()).left();
+ QRect rect = t.mapRect(QRect(10, 10, 10, 10)).adjusted(-adjust, 0, -adjust + 1, 1);
+ QPixmap subpix = pix.copy(rect);
+
+ QImage im = subpix.toImage();
+ for(int i = 0; i < im.width(); i++) {
+ for(int j = 0; j < im.height(); j++)
+ QCOMPARE(qAlpha(im.pixel(i, j)), 125);
+ }
+
+ delete view;
+ }
}
QTEST_MAIN(tst_QGraphicsScene)
diff --git a/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp b/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp
index 6941d23..587b7d5 100644
--- a/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp
+++ b/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp
@@ -462,7 +462,7 @@ void tst_QGraphicsWidget::focusWidget()
QFETCH(int, childWithFocus);
SubQGraphicsWidget *widget = children[childWithFocus];
widget->setFocus();
- QVERIFY(widget->hasFocus());
+ QTRY_VERIFY(widget->hasFocus());
QCOMPARE(parent->focusWidget(), static_cast<QGraphicsWidget*>(widget));
}
}
@@ -479,23 +479,23 @@ void tst_QGraphicsWidget::focusWidget2()
scene.addItem(widget);
- QVERIFY(!widget->hasFocus());
+ QTRY_VERIFY(!widget->hasFocus());
widget->setFocusPolicy(Qt::StrongFocus);
- QVERIFY(!widget->hasFocus());
+ QTRY_VERIFY(!widget->hasFocus());
QGraphicsWidget *subWidget = new QGraphicsWidget(widget);
- QVERIFY(!subWidget->hasFocus());
+ QTRY_VERIFY(!subWidget->hasFocus());
scene.setFocus();
- QVERIFY(!widget->hasFocus());
- QVERIFY(!subWidget->hasFocus());
+ QTRY_VERIFY(!widget->hasFocus());
+ QTRY_VERIFY(!subWidget->hasFocus());
widget->setFocus();
- QVERIFY(widget->hasFocus());
- QCOMPARE(focusInSpy.count(), 1);
- QVERIFY(!subWidget->hasFocus());
+ QTRY_VERIFY(widget->hasFocus());
+ QTRY_COMPARE(focusInSpy.count(), 1);
+ QTRY_VERIFY(!subWidget->hasFocus());
QGraphicsWidget *otherSubWidget = new QGraphicsWidget;
EventSpy otherFocusInSpy(otherSubWidget, QEvent::FocusIn);
@@ -504,18 +504,18 @@ void tst_QGraphicsWidget::focusWidget2()
otherSubWidget->setFocusPolicy(Qt::StrongFocus);
otherSubWidget->setParentItem(widget);
- QVERIFY(widget->hasFocus());
+ QTRY_VERIFY(widget->hasFocus());
QCOMPARE(scene.focusItem(), (QGraphicsItem *)widget);
- QVERIFY(!subWidget->hasFocus());
- QVERIFY(!otherSubWidget->hasFocus());
+ QTRY_VERIFY(!subWidget->hasFocus());
+ QTRY_VERIFY(!otherSubWidget->hasFocus());
widget->hide();
- QVERIFY(!widget->hasFocus()); // lose but still has subfocus
+ QTRY_VERIFY(!widget->hasFocus()); // lose but still has subfocus
QCOMPARE(focusInSpy.count(), 1);
QCOMPARE(focusOutSpy.count(), 1);
widget->show();
- QVERIFY(!widget->hasFocus()); // no regain
+ QTRY_VERIFY(!widget->hasFocus()); // no regain
QCOMPARE(focusInSpy.count(), 1);
QCOMPARE(focusOutSpy.count(), 1);
@@ -523,24 +523,24 @@ void tst_QGraphicsWidget::focusWidget2()
// try to setup subFocus on item that can't take focus
subWidget->setFocus();
- QVERIFY(!subWidget->hasFocus());
+ QTRY_VERIFY(!subWidget->hasFocus());
QVERIFY(!scene.focusItem()); // but isn't the scene's focus item
// try to setup subFocus on item that can take focus
otherSubWidget->setFocus();
- QVERIFY(!otherSubWidget->hasFocus());
+ QTRY_VERIFY(!otherSubWidget->hasFocus());
QCOMPARE(widget->focusWidget(), otherSubWidget);
QVERIFY(!scene.focusItem()); // but isn't the scene's focus item
widget->show();
- QCOMPARE(scene.focusItem(), (QGraphicsItem *)otherSubWidget); // but isn't the scene's focus item
+ QTRY_COMPARE(scene.focusItem(), (QGraphicsItem *)otherSubWidget); // but isn't the scene's focus item
QCOMPARE(otherFocusInSpy.count(), 1);
QCOMPARE(otherFocusOutSpy.count(), 0);
delete otherSubWidget;
- QCOMPARE(otherFocusOutSpy.count(), 1);
+ QTRY_COMPARE(otherFocusOutSpy.count(), 1);
QVERIFY(!scene.focusItem());
QVERIFY(!widget->focusWidget());
}
@@ -579,16 +579,16 @@ void tst_QGraphicsWidget::focusPolicy()
SubQGraphicsWidget *widget = new SubQGraphicsWidget;
scene.addItem(widget);
- QCOMPARE(Qt::NoFocus, widget->focusPolicy());
+ QTRY_COMPARE(Qt::NoFocus, widget->focusPolicy());
QFETCH(Qt::FocusPolicy, focusPolicy1);
widget->setFocusPolicy(focusPolicy1);
- QCOMPARE(widget->focusPolicy(), focusPolicy1);
+ QTRY_COMPARE(widget->focusPolicy(), focusPolicy1);
bool isFocusable = widget->flags() & QGraphicsItem::ItemIsFocusable;
bool wasFocusable = isFocusable;
- QVERIFY(isFocusable == (focusPolicy1 != Qt::NoFocus));
+ QTRY_VERIFY(isFocusable == (focusPolicy1 != Qt::NoFocus));
widget->setFocus();
- QCOMPARE(widget->hasFocus(), isFocusable);
+ QTRY_COMPARE(widget->hasFocus(), isFocusable);
QFETCH(Qt::FocusPolicy, focusPolicy2);
widget->setFocusPolicy(focusPolicy2);
@@ -691,25 +691,21 @@ void tst_QGraphicsWidget::fontChangedEvent()
EventSpy rootSpyFont(root, QEvent::FontChange);
EventSpy rootSpyPolish(root, QEvent::Polish);
- QCOMPARE(rootSpyFont.count(), 0);
- QApplication::processEvents(); //The polish event is sent
- QCOMPARE(rootSpyPolish.count(), 1);
- QApplication::processEvents(); //Process events to see if we get the font change event
+ QTRY_COMPARE(rootSpyFont.count(), 0);
+ QTRY_COMPARE(rootSpyPolish.count(), 1);
//The font is still the same so no fontChangeEvent
- QCOMPARE(rootSpyFont.count(), 0);
+ QTRY_COMPARE(rootSpyFont.count(), 0);
QFont font;
font.setPointSize(43);
root->setFont(font);
- QApplication::processEvents(); //Process events to get the font change event
//The font changed
- QCOMPARE(rootSpyFont.count(), 1);
+ QTRY_COMPARE(rootSpyFont.count(), 1);
//then roll back to the default one.
root->setFont(appFont);
- QApplication::processEvents(); //Process events to get the font change event
//The font changed
- QCOMPARE(rootSpyFont.count(), 2);
+ QTRY_COMPARE(rootSpyFont.count(), 2);
}
void tst_QGraphicsWidget::fontPropagationWidgetItemWidget()
@@ -770,11 +766,13 @@ void tst_QGraphicsWidget::geometry()
{
SubQGraphicsWidget widget;
QCOMPARE(widget.geometry(), QRectF(widget.pos(), widget.size()));
-
+ QSignalSpy spy(&widget, SIGNAL(geometryChanged()));
QFETCH(QPointF, pos);
QFETCH(QSizeF, size);
widget.setPos(pos);
widget.resize(size);
+ if (!size.isNull())
+ QCOMPARE(spy.count(), 1);
QCOMPARE(widget.geometry(), QRectF(pos, size));
}
@@ -843,7 +841,6 @@ void tst_QGraphicsWidget::initStyleOption()
qt_x11_wait_for_window_manager(&view);
#endif
QApplication::setActiveWindow(&view);
- QTest::qWait(25);
QTRY_COMPARE(QApplication::activeWindow(), &view);
view.setAlignment(Qt::AlignTop | Qt::AlignLeft);
@@ -868,7 +865,6 @@ void tst_QGraphicsWidget::initStyleOption()
view.resize(300, 300);
view.show();
QTest::qWaitForWindowShown(&view);
- QTest::qWait(20);
sendMouseMove(view.viewport(), view.mapFromScene(widget->mapToScene(widget->boundingRect().center())));
}
@@ -921,9 +917,7 @@ void tst_QGraphicsWidget::layout()
}
widget.setLayout(layout);
- QTest::qWait(25);
-
- QCOMPARE(widget.layout(), static_cast<QGraphicsLayout*>(layout));
+ QTRY_COMPARE(widget.layout(), static_cast<QGraphicsLayout*>(layout));
for (int i = 0; i < children.count(); ++i) {
SubQGraphicsWidget *item = children[i];
QCOMPARE(item->parentWidget(), (QGraphicsWidget *)&widget);
@@ -963,10 +957,9 @@ void tst_QGraphicsWidget::layoutDirection()
view->show();
QTest::qWaitForWindowShown(view);
for (int i = 0; i < children.count(); ++i) {
- QCOMPARE(children[i]->layoutDirection(), layoutDirection);
- QCOMPARE(children[i]->testAttribute(Qt::WA_SetLayoutDirection), false);
+ QTRY_COMPARE(children[i]->layoutDirection(), layoutDirection);
+ QTRY_COMPARE(children[i]->testAttribute(Qt::WA_SetLayoutDirection), false);
view->repaint();
- QApplication::processEvents();
QTRY_COMPARE(children[i]->m_painterLayoutDirection, layoutDirection);
}
delete view;
@@ -1179,7 +1172,6 @@ void tst_QGraphicsWidget::setTabOrder()
qt_x11_wait_for_window_manager(&view);
#endif
QApplication::setActiveWindow(&view);
- QTest::qWait(25);
QTRY_COMPARE(QApplication::activeWindow(), &view);
QGraphicsWidget *lastItem = 0;
@@ -1200,7 +1192,6 @@ void tst_QGraphicsWidget::setTabOrder()
if (!children.isEmpty()) {
QGraphicsWidget *first = children.first();
view.viewport()->setFocus();
- QApplication::processEvents();
QTRY_VERIFY(view.viewport()->hasFocus());
first->setFocus();
QVERIFY(first->hasFocus());
@@ -1461,18 +1452,14 @@ void tst_QGraphicsWidget::verifyFocusChain()
QTest::qWaitForWindowShown(window);
lineEdit->setFocus();
- QTest::qWait(25);
QTRY_VERIFY(lineEdit->hasFocus());
QTest::keyPress(QApplication::focusWidget(), Qt::Key_Tab);
- QTest::qWait(25);
QTRY_VERIFY(w1_1->hasFocus());
QTest::keyPress(QApplication::focusWidget(), Qt::Key_Tab);
- QTest::qWait(25);
QTRY_VERIFY(w1_2->hasFocus());
// remove the tabFocusFirst and insert new item
delete w1_1; // calls _q_removeItemLater
- QTest::qWait(25);
SubQGraphicsWidget *w1_3 = new SubQGraphicsWidget;
w1_3->setFocusPolicy(Qt::StrongFocus);
w1_3->setData(0, "w1_3");
@@ -1480,14 +1467,11 @@ void tst_QGraphicsWidget::verifyFocusChain()
scene.addItem(w1_3);
QTRY_VERIFY(w1_2->hasFocus());
QTest::keyPress(QApplication::focusWidget(), Qt::Key_Backtab);
- QTest::qWait(25);
QTRY_VERIFY(lineEdit->hasFocus());
// tabFocusFirst should now point to w1_2
QTest::keyPress(QApplication::focusWidget(), Qt::Key_Tab);
- QTest::qWait(25);
QTRY_VERIFY(w1_2->hasFocus());
QTest::keyPress(QApplication::focusWidget(), Qt::Key_Tab);
- QTest::qWait(25);
QTRY_VERIFY(w1_3->hasFocus());
scene.removeItem(w1_2); // does not call _q_removeItemLater
delete w1_2; // calls _q_removeItemLater
@@ -1498,16 +1482,12 @@ void tst_QGraphicsWidget::verifyFocusChain()
w1_4->setGeometry(75,0,25, 25);
scene.addItem(w1_4);
QTRY_VERIFY(w1_3->hasFocus());
- QTest::qWait(25);
QTRY_VERIFY(compareFocusChain(view, QList<QGraphicsItem*>() << w1_3 << w1_4));
QTest::keyPress(QApplication::focusWidget(), Qt::Key_Backtab);
- QTest::qWait(25);
QTRY_VERIFY(lineEdit->hasFocus());
// tabFocusFirst should now point to w1_3
QTest::keyPress(QApplication::focusWidget(), Qt::Key_Tab);
- QTest::qWait(25);
QTRY_VERIFY(w1_3->hasFocus());
- QTest::qWait(25);
QTRY_VERIFY(compareFocusChain(view, QList<QGraphicsItem*>() << w1_3 << w1_4));
delete window;
}
@@ -1522,7 +1502,6 @@ void tst_QGraphicsWidget::updateFocusChainWhenChildDie()
qt_x11_wait_for_window_manager(&view);
#endif
QApplication::setActiveWindow(&view);
- QTest::qWait(25);
QTRY_COMPARE(QApplication::activeWindow(), &view);
// delete item in focus chain with no focus and verify chain
@@ -1756,31 +1735,29 @@ void tst_QGraphicsWidget::setSizes()
widget->setPreferredSize(pref);
widget->setMaximumSize(max);
- QApplication::processEvents();
-
for (i = 0; i < compareInstructions.count(); ++i) {
Inst input = compareInstructions.at(i);
switch (input.first) {
case MinimumSize:
- QCOMPARE(widget->minimumSize(), input.second.toSizeF());
+ QTRY_COMPARE(widget->minimumSize(), input.second.toSizeF());
break;
case PreferredSize:
- QCOMPARE(widget->preferredSize(), input.second.toSizeF());
+ QTRY_COMPARE(widget->preferredSize(), input.second.toSizeF());
break;
case MaximumSize:
- QCOMPARE(widget->maximumSize(), input.second.toSizeF());
+ QTRY_COMPARE(widget->maximumSize(), input.second.toSizeF());
break;
case Size:
- QCOMPARE(widget->size(), input.second.toSizeF());
+ QTRY_COMPARE(widget->size(), input.second.toSizeF());
break;
case MinimumWidth:
- QCOMPARE(widget->minimumWidth(), qreal(input.second.toDouble()));
+ QTRY_COMPARE(widget->minimumWidth(), qreal(input.second.toDouble()));
break;
case PreferredWidth:
- QCOMPARE(widget->preferredWidth(), qreal(input.second.toDouble()));
+ QTRY_COMPARE(widget->preferredWidth(), qreal(input.second.toDouble()));
break;
case MaximumWidth:
- QCOMPARE(widget->maximumWidth(), qreal(input.second.toDouble()));
+ QTRY_COMPARE(widget->maximumWidth(), qreal(input.second.toDouble()));
break;
default:
qWarning("instruction not implemented");
@@ -1835,14 +1812,13 @@ void tst_QGraphicsWidget::task236127_bspTreeIndexFails()
#ifdef Q_WS_X11
qt_x11_wait_for_window_manager(&view);
#endif
- QTest::qWait(100);
- QVERIFY(!scene.itemAt(25, 25));
+ QTRY_VERIFY(!scene.itemAt(25, 25));
widget->setGeometry(0, 112, 360, 528);
- QCOMPARE(scene.itemAt(15, 120), (QGraphicsItem *)widget);
+ QTRY_COMPARE(scene.itemAt(15, 120), (QGraphicsItem *)widget);
widget2->setGeometry(0, 573, 360, 67);
- QCOMPARE(scene.itemAt(15, 120), (QGraphicsItem *)widget);
- QCOMPARE(scene.itemAt(50, 585), (QGraphicsItem *)widget2);
+ QTRY_COMPARE(scene.itemAt(15, 120), (QGraphicsItem *)widget);
+ QTRY_COMPARE(scene.itemAt(50, 585), (QGraphicsItem *)widget2);
}
void tst_QGraphicsWidget::defaultSize()
@@ -1857,7 +1833,6 @@ void tst_QGraphicsWidget::defaultSize()
#ifdef Q_WS_X11
qt_x11_wait_for_window_manager(&view);
#endif
- QTest::qWait(50);
QSizeF initialSize = widget->size();
widget->resize(initialSize);
@@ -1867,9 +1842,8 @@ void tst_QGraphicsWidget::defaultSize()
widget->setPreferredSize(60, 60);
widget->setMaximumSize(110, 110);
widget->setVisible(true);
- QTest::qWait(50);
// should still have its size set to initialsize
- QCOMPARE(widget->geometry().size(), initialSize);
+ QTRY_COMPARE(widget->geometry().size(), initialSize);
}
@@ -2391,7 +2365,6 @@ void tst_QGraphicsWidget::painterStateProtectionOnWindowFrame()
scene.addItem(widget);
view.show();
QTest::qWaitForWindowShown(&view);
- QTest::qWait(500);
}
class ProxyStyle : public QCommonStyle
@@ -2480,7 +2453,6 @@ void tst_QGraphicsWidget::task250119_shortcutContext()
view.setScene(&scene);
view.show();
QApplication::setActiveWindow(&view);
- QTest::qWait(25);
QTRY_COMPARE(QApplication::activeWindow(), &view);
@@ -2735,9 +2707,7 @@ void tst_QGraphicsWidget::respectHFW()
QTest::qWaitForWindowShown(view);
{ // here we go - simulate a interactive resize of the window
- QTest::qWait(100);
QTest::mouseMove(view, view->mapFromScene(71, 71)); // bottom right corner
- QTest::qWait(100);
QTest::mousePress(view->viewport(), Qt::LeftButton, 0, view->mapFromScene(71, 71), 200);
view->grabMouse();
@@ -2751,10 +2721,9 @@ void tst_QGraphicsWidget::respectHFW()
QApplication::sendEvent(view->viewport(), &e);
view->releaseMouse();
}
- QTest::qWait(100);
const QSizeF winSize = window->size();
qreal minHFW = window->effectiveSizeHint(Qt::MinimumSize, QSizeF(winSize.width(), -1)).height();
- QVERIFY(qAbs(minHFW - winSize.height()) < 1);
+ QTRY_VERIFY(qAbs(minHFW - winSize.height()) < 1);
#endif
}
@@ -2806,7 +2775,7 @@ void tst_QGraphicsWidget::addChildInpolishEvent()
view.resize(200, 200);
view.show();
QTest::qWaitForWindowShown(&view);
- QCOMPARE(PolishWidget::numberOfPolish, 2);
+ QTRY_COMPARE(PolishWidget::numberOfPolish, 2);
}
void tst_QGraphicsWidget::polishEvent()
@@ -2853,10 +2822,8 @@ void tst_QGraphicsWidget::polishEvent2()
widget->events.clear();
- QApplication::processEvents();
-
// Make sure the item got polish event.
- QVERIFY(widget->events.contains(QEvent::Polish));
+ QTRY_VERIFY(widget->events.contains(QEvent::Polish));
}
void tst_QGraphicsWidget::autoFillBackground()
@@ -2902,11 +2869,9 @@ void tst_QGraphicsWidget::initialShow()
view.show();
QTest::qWaitForWindowShown(&view);
- QTest::qWait(100);
scene.addItem(widget);
- QTest::qWait(100);
- QCOMPARE(widget->repaints, 1);
+ QTRY_COMPARE(widget->repaints, 1);
}
void tst_QGraphicsWidget::initialShow2()
@@ -2935,7 +2900,6 @@ void tst_QGraphicsWidget::initialShow2()
const int expectedRepaintCount = paintSpy.count();
delete dummyView;
dummyView = 0;
- QTest::qWait(200);
MyGraphicsWidget *widget = new MyGraphicsWidget;
widget->resize(100, 100);
@@ -2948,7 +2912,7 @@ void tst_QGraphicsWidget::initialShow2()
view.show();
QTest::qWaitForWindowShown(&view);
- QCOMPARE(widget->repaints, expectedRepaintCount);
+ QTRY_COMPARE(widget->repaints, expectedRepaintCount);
}
void tst_QGraphicsWidget::QT_BUG_6544_tabFocusFirstUnsetWhenRemovingItems()
diff --git a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp
index e11900e..4922a89 100644
--- a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp
+++ b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp
@@ -205,6 +205,10 @@ private Q_SLOTS:
#endif
void ioGetFromHttpBrokenServer_data();
void ioGetFromHttpBrokenServer();
+ void ioGetFromHttpStatus100_data();
+ void ioGetFromHttpStatus100();
+ void ioGetFromHttpNoHeaders_data();
+ void ioGetFromHttpNoHeaders();
void ioGetFromHttpWithCache_data();
void ioGetFromHttpWithCache();
@@ -2159,6 +2163,60 @@ void tst_QNetworkReply::ioGetFromHttpBrokenServer()
QVERIFY(reply->error() != QNetworkReply::NoError);
}
+void tst_QNetworkReply::ioGetFromHttpStatus100_data()
+{
+ QTest::addColumn<QByteArray>("dataToSend");
+ QTest::newRow("normal") << QByteArray("HTTP/1.1 100 Continue\r\n\r\nHTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n");
+ QTest::newRow("minimal") << QByteArray("HTTP/1.1 100 Continue\n\nHTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n");
+ QTest::newRow("minimal2") << QByteArray("HTTP/1.1 100 Continue\n\nHTTP/1.0 200 OK\r\n\r\n");
+ QTest::newRow("minimal3") << QByteArray("HTTP/1.1 100 Continue\n\nHTTP/1.0 200 OK\n\n");
+ QTest::newRow("with_headers") << QByteArray("HTTP/1.1 100 Continue\r\nBla: x\r\n\r\nHTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n");
+ QTest::newRow("with_headers2") << QByteArray("HTTP/1.1 100 Continue\nBla: x\n\nHTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n");
+}
+
+void tst_QNetworkReply::ioGetFromHttpStatus100()
+{
+ QFETCH(QByteArray, dataToSend);
+ MiniHttpServer server(dataToSend);
+ server.doClose = true;
+
+ QNetworkRequest request(QUrl("http://localhost:" + QString::number(server.serverPort())));
+ QNetworkReplyPtr reply = manager.get(request);
+
+ connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop()));
+ QTestEventLoop::instance().enterLoop(10);
+ QVERIFY(!QTestEventLoop::instance().timeout());
+
+ QCOMPARE(reply->url(), request.url());
+ QCOMPARE(reply->error(), QNetworkReply::NoError);
+ QCOMPARE(reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(), 200);
+ QVERIFY(reply->rawHeader("bla").isNull());
+}
+
+void tst_QNetworkReply::ioGetFromHttpNoHeaders_data()
+{
+ QTest::addColumn<QByteArray>("dataToSend");
+ QTest::newRow("justStatus+noheaders+disconnect") << QByteArray("HTTP/1.0 200 OK\r\n\r\n");
+}
+
+void tst_QNetworkReply::ioGetFromHttpNoHeaders()
+{
+ QFETCH(QByteArray, dataToSend);
+ MiniHttpServer server(dataToSend);
+ server.doClose = true;
+
+ QNetworkRequest request(QUrl("http://localhost:" + QString::number(server.serverPort())));
+ QNetworkReplyPtr reply = manager.get(request);
+
+ connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop()));
+ QTestEventLoop::instance().enterLoop(10);
+ QVERIFY(!QTestEventLoop::instance().timeout());
+
+ QCOMPARE(reply->url(), request.url());
+ QCOMPARE(reply->error(), QNetworkReply::NoError);
+ QCOMPARE(reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(), 200);
+}
+
void tst_QNetworkReply::ioGetFromHttpWithCache_data()
{
qRegisterMetaType<MyMemoryCache::CachedContent>();
diff --git a/tests/auto/qparallelanimationgroup/tst_qparallelanimationgroup.cpp b/tests/auto/qparallelanimationgroup/tst_qparallelanimationgroup.cpp
index fb0f3e0..d2d86fb 100644
--- a/tests/auto/qparallelanimationgroup/tst_qparallelanimationgroup.cpp
+++ b/tests/auto/qparallelanimationgroup/tst_qparallelanimationgroup.cpp
@@ -75,6 +75,8 @@ private slots:
void loopCount();
void autoAdd();
void pauseResume();
+
+ void QTBUG8910_crashWhenRemovingUncontrolledAnimation();
};
tst_QParallelAnimationGroup::tst_QParallelAnimationGroup()
@@ -999,9 +1001,22 @@ void tst_QParallelAnimationGroup::pauseResume()
QCOMPARE(spy.count(), 2); //this shouldn't have changed
group.resume();
QCOMPARE(spy.count(), 2); //this shouldn't have changed
+}
-
+void tst_QParallelAnimationGroup::QTBUG8910_crashWhenRemovingUncontrolledAnimation()
+{
+ QParallelAnimationGroup group;
+ TestAnimation *anim = new TestAnimation;
+ anim->setLoopCount(-1);
+ TestAnimation *anim2 = new TestAnimation;
+ anim2->setLoopCount(-1);
+ group.addAnimation(anim);
+ group.addAnimation(anim2);
+ group.start();
+ delete anim;
+ // it would crash here because the internals of the group would still have a reference to anim
+ delete anim2;
}
diff --git a/tests/auto/qscriptclass/tst_qscriptclass.cpp b/tests/auto/qscriptclass/tst_qscriptclass.cpp
index aca33ce..b4dbe73 100644
--- a/tests/auto/qscriptclass/tst_qscriptclass.cpp
+++ b/tests/auto/qscriptclass/tst_qscriptclass.cpp
@@ -98,7 +98,12 @@ public:
NotCallable,
CallableReturnsSum,
CallableReturnsArgument,
- CallableReturnsInvalidVariant
+ CallableReturnsInvalidVariant,
+ CallableReturnsGlobalObject,
+ CallableReturnsThisObject,
+ CallableReturnsCallee,
+ CallableReturnsArgumentsObject,
+ CallableInitializesThisObject
};
TestClass(QScriptEngine *engine);
@@ -348,7 +353,7 @@ QVariant TestClass::extension(Extension extension,
qsreal sum = 0;
for (int i = 0; i < ctx->argumentCount(); ++i)
sum += ctx->argument(i).toNumber();
- QScriptValueIterator it(ctx->thisObject());
+ QScriptValueIterator it(ctx->callee());
while (it.hasNext()) {
it.next();
sum += it.value().toNumber();
@@ -358,6 +363,17 @@ QVariant TestClass::extension(Extension extension,
return qVariantFromValue(ctx->argument(0));
} else if (m_callableMode == CallableReturnsInvalidVariant) {
return QVariant();
+ } else if (m_callableMode == CallableReturnsGlobalObject) {
+ return qVariantFromValue(engine()->globalObject());
+ } else if (m_callableMode == CallableReturnsThisObject) {
+ return qVariantFromValue(ctx->thisObject());
+ } else if (m_callableMode == CallableReturnsCallee) {
+ return qVariantFromValue(ctx->callee());
+ } else if (m_callableMode == CallableReturnsArgumentsObject) {
+ return qVariantFromValue(ctx->argumentsObject());
+ } else if (m_callableMode == CallableInitializesThisObject) {
+ engine()->newQObject(ctx->thisObject(), engine());
+ return QVariant();
}
} else if (extension == HasInstance) {
Q_ASSERT(m_hasInstance);
@@ -797,9 +813,11 @@ void tst_QScriptClass::extension()
QVERIFY(cls.supportsExtension(QScriptClass::Callable));
QScriptValue obj = eng.newObject(&cls);
+ eng.globalObject().setProperty("obj", obj);
obj.setProperty("one", QScriptValue(&eng, 1));
obj.setProperty("two", QScriptValue(&eng, 2));
obj.setProperty("three", QScriptValue(&eng, 3));
+ // From C++
cls.clearReceivedArgs();
{
QScriptValueList args;
@@ -810,8 +828,18 @@ void tst_QScriptClass::extension()
QVERIFY(ret.isNumber());
QCOMPARE(ret.toNumber(), qsreal(15));
}
+ // From JS
+ cls.clearReceivedArgs();
+ {
+ QScriptValue ret = eng.evaluate("obj(4, 5)");
+ QCOMPARE(cls.lastExtensionType(), QScriptClass::Callable);
+ QCOMPARE(cls.lastExtensionArgument().userType(), qMetaTypeId<QScriptContext*>());
+ QVERIFY(ret.isNumber());
+ QCOMPARE(ret.toNumber(), qsreal(15));
+ }
cls.setCallableMode(TestClass::CallableReturnsArgument);
+ // From C++
cls.clearReceivedArgs();
{
QScriptValue ret = obj.call(obj, QScriptValueList() << 123);
@@ -843,6 +871,13 @@ void tst_QScriptClass::extension()
QScriptValue ret = obj.call(obj, QScriptValueList() << QScriptValue());
QVERIFY(ret.isUndefined());
}
+ // From JS
+ cls.clearReceivedArgs();
+ {
+ QScriptValue ret = eng.evaluate("obj(123)");
+ QVERIFY(ret.isNumber());
+ QCOMPARE(ret.toInt32(), 123);
+ }
cls.setCallableMode(TestClass::CallableReturnsInvalidVariant);
{
@@ -850,13 +885,92 @@ void tst_QScriptClass::extension()
QVERIFY(ret.isUndefined());
}
+ cls.setCallableMode(TestClass::CallableReturnsThisObject);
+ // From C++
+ {
+ QScriptValue ret = obj.call(obj);
+ QVERIFY(ret.isObject());
+ QVERIFY(ret.strictlyEquals(obj));
+ }
+ // From JS
+ {
+ QScriptValue ret = eng.evaluate("obj()");
+ QVERIFY(ret.isObject());
+ QVERIFY(ret.strictlyEquals(eng.globalObject()));
+ }
+
+ cls.setCallableMode(TestClass::CallableReturnsCallee);
+ // From C++
+ {
+ QScriptValue ret = obj.call();
+ QVERIFY(ret.isObject());
+ QVERIFY(ret.strictlyEquals(obj));
+ }
+ // From JS
+ {
+ QScriptValue ret = eng.evaluate("obj()");
+ QVERIFY(ret.isObject());
+ QVERIFY(ret.strictlyEquals(obj));
+ }
+
+ cls.setCallableMode(TestClass::CallableReturnsArgumentsObject);
+ // From C++
+ {
+ QScriptValue ret = obj.call(obj, QScriptValueList() << 123);
+ QVERIFY(ret.isObject());
+ QVERIFY(ret.property("length").isNumber());
+ QCOMPARE(ret.property("length").toInt32(), 1);
+ QVERIFY(ret.property(0).isNumber());
+ QCOMPARE(ret.property(0).toInt32(), 123);
+ }
+ // From JS
+ {
+ QScriptValue ret = eng.evaluate("obj(123)");
+ QVERIFY(ret.isObject());
+ QVERIFY(ret.property("length").isNumber());
+ QCOMPARE(ret.property("length").toInt32(), 1);
+ QVERIFY(ret.property(0).isNumber());
+ QCOMPARE(ret.property(0).toInt32(), 123);
+ }
+
// construct()
+ // From C++
cls.clearReceivedArgs();
+ cls.setCallableMode(TestClass::CallableReturnsGlobalObject);
{
QScriptValue ret = obj.construct();
QCOMPARE(cls.lastExtensionType(), QScriptClass::Callable);
QCOMPARE(cls.lastExtensionArgument().userType(), qMetaTypeId<QScriptContext*>());
QVERIFY(ret.isObject());
+ QVERIFY(ret.strictlyEquals(eng.globalObject()));
+ }
+ // From JS
+ cls.clearReceivedArgs();
+ {
+ QScriptValue ret = eng.evaluate("new obj()");
+ QCOMPARE(cls.lastExtensionType(), QScriptClass::Callable);
+ QCOMPARE(cls.lastExtensionArgument().userType(), qMetaTypeId<QScriptContext*>());
+ QVERIFY(ret.isObject());
+ QVERIFY(ret.strictlyEquals(eng.globalObject()));
+ }
+ // From C++
+ cls.clearReceivedArgs();
+ cls.setCallableMode(TestClass::CallableInitializesThisObject);
+ {
+ QScriptValue ret = obj.construct();
+ QCOMPARE(cls.lastExtensionType(), QScriptClass::Callable);
+ QCOMPARE(cls.lastExtensionArgument().userType(), qMetaTypeId<QScriptContext*>());
+ QVERIFY(ret.isQObject());
+ QCOMPARE(ret.toQObject(), (QObject*)&eng);
+ }
+ // From JS
+ cls.clearReceivedArgs();
+ {
+ QScriptValue ret = eng.evaluate("new obj()");
+ QCOMPARE(cls.lastExtensionType(), QScriptClass::Callable);
+ QCOMPARE(cls.lastExtensionArgument().userType(), qMetaTypeId<QScriptContext*>());
+ QVERIFY(ret.isQObject());
+ QCOMPARE(ret.toQObject(), (QObject*)&eng);
}
}
// HasInstance
diff --git a/tests/auto/qscriptengine/tst_qscriptengine.cpp b/tests/auto/qscriptengine/tst_qscriptengine.cpp
index d9beb45..e71d7c3 100644
--- a/tests/auto/qscriptengine/tst_qscriptengine.cpp
+++ b/tests/auto/qscriptengine/tst_qscriptengine.cpp
@@ -150,6 +150,7 @@ private slots:
void getSetAgent();
void reentrancy();
void incDecNonObjectProperty();
+ void installTranslatorFunctions_data();
void installTranslatorFunctions();
void functionScopes();
void nativeFunctionScopes();
@@ -4119,22 +4120,46 @@ void tst_QScriptEngine:: incDecNonObjectProperty()
}
}
+void tst_QScriptEngine::installTranslatorFunctions_data()
+{
+ QTest::addColumn<bool>("useCustomGlobalObject");
+
+ QTest::newRow("Default global object") << false;
+ QTest::newRow("Custom global object") << true;
+}
+
void tst_QScriptEngine::installTranslatorFunctions()
{
+ QFETCH(bool, useCustomGlobalObject);
+
QScriptEngine eng;
- QScriptValue global = eng.globalObject();
+ QScriptValue globalOrig = eng.globalObject();
+ QScriptValue global;
+ if (useCustomGlobalObject) {
+ global = eng.newObject();
+ eng.setGlobalObject(global);
+ } else {
+ global = globalOrig;
+ }
QVERIFY(!global.property("qsTranslate").isValid());
QVERIFY(!global.property("QT_TRANSLATE_NOOP").isValid());
QVERIFY(!global.property("qsTr").isValid());
QVERIFY(!global.property("QT_TR_NOOP").isValid());
- QVERIFY(!global.property("String").property("prototype").property("arg").isValid());
+ QVERIFY(!globalOrig.property("String").property("prototype").property("arg").isValid());
eng.installTranslatorFunctions();
QVERIFY(global.property("qsTranslate").isFunction());
QVERIFY(global.property("QT_TRANSLATE_NOOP").isFunction());
QVERIFY(global.property("qsTr").isFunction());
QVERIFY(global.property("QT_TR_NOOP").isFunction());
- QVERIFY(global.property("String").property("prototype").property("arg").isFunction());
+ QVERIFY(globalOrig.property("String").property("prototype").property("arg").isFunction());
+
+ if (useCustomGlobalObject) {
+ QVERIFY(!globalOrig.property("qsTranslate").isValid());
+ QVERIFY(!globalOrig.property("QT_TRANSLATE_NOOP").isValid());
+ QVERIFY(!globalOrig.property("qsTr").isValid());
+ QVERIFY(!globalOrig.property("QT_TR_NOOP").isValid());
+ }
{
QScriptValue ret = eng.evaluate("qsTr('foo')");
diff --git a/tests/auto/qscriptvalue/tst_qscriptvalue.cpp b/tests/auto/qscriptvalue/tst_qscriptvalue.cpp
index 5b79340..dc369aa 100644
--- a/tests/auto/qscriptvalue/tst_qscriptvalue.cpp
+++ b/tests/auto/qscriptvalue/tst_qscriptvalue.cpp
@@ -2573,6 +2573,10 @@ void tst_QScriptValue::call()
// call with something else as arguments
QScriptValue ret5 = fun.call(QScriptValue(), QScriptValue(&eng, 123.0));
QCOMPARE(ret5.isError(), true);
+ // call with a non-array object as arguments
+ QScriptValue ret6 = fun.call(QScriptValue(), eng.globalObject());
+ QVERIFY(ret6.isError());
+ QCOMPARE(ret6.toString(), QString::fromLatin1("TypeError: Arguments must be an array"));
}
// calling things that are not functions
@@ -2705,6 +2709,10 @@ void tst_QScriptValue::construct()
// construct with something else as arguments
QScriptValue ret5 = fun.construct(QScriptValue(&eng, 123.0));
QCOMPARE(ret5.isError(), true);
+ // construct with a non-array object as arguments
+ QScriptValue ret6 = fun.construct(eng.globalObject());
+ QVERIFY(ret6.isError());
+ QCOMPARE(ret6.toString(), QString::fromLatin1("TypeError: Arguments must be an array"));
}
// construct on things that are not functions