aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qdeclarativeqt
diff options
context:
space:
mode:
authorAurindam Jana <aurindam.jana@nokia.com>2011-11-10 15:59:05 +0100
committerQt by Nokia <qt-info@nokia.com>2011-12-14 04:51:21 +0100
commit0f2188361b996c4d8b8901412cdcebf35bad1e53 (patch)
tree1d5d5c9344d8b2464ed792560b96821f4d59b611 /tests/auto/declarative/qdeclarativeqt
parentf1bcbd1ebae5d7b894b4da51fd82de0d0d58e99d (diff)
QV8Engine: Console APIs, Extend functionality
Added console.trace, console.profile, console.profileEnd. Change-Id: Icc38ddd550989eaba0085ece120695a13ec17322 Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
Diffstat (limited to 'tests/auto/declarative/qdeclarativeqt')
-rw-r--r--tests/auto/declarative/qdeclarativeqt/data/console.qml (renamed from tests/auto/declarative/qdeclarativeqt/data/consoleLog.qml)6
-rw-r--r--tests/auto/declarative/qdeclarativeqt/tst_qdeclarativeqt.cpp17
2 files changed, 16 insertions, 7 deletions
diff --git a/tests/auto/declarative/qdeclarativeqt/data/consoleLog.qml b/tests/auto/declarative/qdeclarativeqt/data/console.qml
index 2692abb82e..634239c31f 100644
--- a/tests/auto/declarative/qdeclarativeqt/data/consoleLog.qml
+++ b/tests/auto/declarative/qdeclarativeqt/data/console.qml
@@ -11,7 +11,8 @@ QtObject {
var f = true
var g = {toString: function() { throw new Error('toString'); }}
-
+ console.profile("profile1")
+ console.time("timer1")
console.log("completed", "ok")
console.log("completed ok")
console.debug("completed ok")
@@ -27,6 +28,9 @@ QtObject {
console.log(g)
console.log(1, "pong!", new Object)
console.log(1, ["ping","pong"], new Object, 2)
+ console.trace()
+ console.timeEnd("timer1")
+ console.profileEnd("profile1")
console.log(exception) //This has to be at the end
}
}
diff --git a/tests/auto/declarative/qdeclarativeqt/tst_qdeclarativeqt.cpp b/tests/auto/declarative/qdeclarativeqt/tst_qdeclarativeqt.cpp
index 5b3ea5e169..6171800ade 100644
--- a/tests/auto/declarative/qdeclarativeqt/tst_qdeclarativeqt.cpp
+++ b/tests/auto/declarative/qdeclarativeqt/tst_qdeclarativeqt.cpp
@@ -78,7 +78,7 @@ private slots:
void createComponent();
void createComponent_pragmaLibrary();
void createQmlObject();
- void consoleLog();
+ void console();
void dateTimeConversion();
void dateTimeFormatting();
void dateTimeFormatting_data();
@@ -458,10 +458,14 @@ void tst_qdeclarativeqt::createQmlObject()
delete object;
}
-void tst_qdeclarativeqt::consoleLog()
+void tst_qdeclarativeqt::console()
{
- int startLineNumber = 30;
- QUrl testFileUrl = TEST_FILE("consoleLog.qml");
+ QUrl testFileUrl = TEST_FILE("console.qml");
+ QString testException = QString(QLatin1String("%1:%2: ReferenceError: Can't find variable: exception")).arg(testFileUrl.toString()).arg(34);
+ QString testTrace = QString(QLatin1String("onCompleted (%1:%2:%3)\n")).arg(testFileUrl.toString()).arg(31).arg(17);
+ QTest::ignoreMessage(QtDebugMsg, qPrintable(testTrace));
+ QTest::ignoreMessage(QtDebugMsg, "Profiling started.");
+ QTest::ignoreMessage(QtDebugMsg, "Profiling ended.");
QTest::ignoreMessage(QtDebugMsg, "completed ok");
QTest::ignoreMessage(QtDebugMsg, "completed ok");
QTest::ignoreMessage(QtDebugMsg, "completed ok");
@@ -479,8 +483,9 @@ void tst_qdeclarativeqt::consoleLog()
QTest::ignoreMessage(QtDebugMsg, "1 pong! Object");
QTest::ignoreMessage(QtDebugMsg, "1 [ping,pong] Object 2");
- QString testException = QString(QLatin1String("%1:%2: ReferenceError: Can't find variable: exception")).arg(testFileUrl.toString());
- QTest::ignoreMessage(QtWarningMsg, qPrintable(testException.arg(startLineNumber++)));
+
+ QTest::ignoreMessage(QtWarningMsg, qPrintable(testException));
+
QDeclarativeComponent component(&engine, testFileUrl);
QObject *object = component.create();