summaryrefslogtreecommitdiff
path: root/tests/auto/declarative_core/tst_place.qml
diff options
context:
space:
mode:
authorabcd <amos.choy@nokia.com>2012-01-27 12:28:28 +1000
committerQt by Nokia <qt-info@nokia.com>2012-01-30 04:40:48 +0100
commit074260af5a59c2a6a9d49cf0b4b9e8a5db5b11f8 (patch)
treec99d3107da3df7971e7062bbdee172c1775aeb2f /tests/auto/declarative_core/tst_place.qml
parent2250712e52f15dae62e74f2106e2226a42635deb (diff)
downloadqtlocation-074260af5a59c2a6a9d49cf0b4b9e8a5db5b11f8.tar.gz
Refactor Icons
Change-Id: I702e8a1b6f0e80cb990315165f1bf331a82e65a5 Reviewed-by: Aaron McCarthy <aaron.mccarthy@nokia.com>
Diffstat (limited to 'tests/auto/declarative_core/tst_place.qml')
-rw-r--r--tests/auto/declarative_core/tst_place.qml39
1 files changed, 25 insertions, 14 deletions
diff --git a/tests/auto/declarative_core/tst_place.qml b/tests/auto/declarative_core/tst_place.qml
index 77acc7ab..c4d5c46d 100644
--- a/tests/auto/declarative_core/tst_place.qml
+++ b/tests/auto/declarative_core/tst_place.qml
@@ -105,8 +105,10 @@ TestCase {
supplierId: "supplier-id-1"
url: "http://www.example.com/supplier-id-1/"
icon: Icon{
- fullUrl: "http://www.example.com/supplier-id-1/icon"
plugin: testPlugin
+ Component.onCompleted: {
+ parameters.singleUrl = "http://www.example.com/supplier-id-1/icon"
+ }
}
}
@@ -124,7 +126,9 @@ TestCase {
]
icon: Icon {
- fullUrl: "http://example.com/test-place.png"
+ Component.onCompleted: {
+ savePlace.icon.parameters.singleUrl = "http://example.com/test-place.png";
+ }
}
}
@@ -182,10 +186,17 @@ TestCase {
if (place1.supplier.icon !== null && place2.supplier.icon === null)
return false;
if (place1.supplier.icon !== null && place2.supplier.icon !== null) {
- if (place1.supplier.icon.fullUrl !== place2.supplier.icon.fullUrl)
- return false;
- if (place1.supplier.icon.baseUrl !== place2.supplier.icon.baseUrl)
+ if (place1.supplier.icon.parameters.keys().length !== place2.supplier.icon.parameters.keys().length) {
return false;
+ }
+
+ var keys = place1.supplier.icon.parameters.keys() + place2.supplier.icon.parameters.keys();
+ for (var i = 0; i < keys.length; ++i) {
+ if (place1.supplier.icon.parameters[keys[i]] != place2.supplier.icon.parameters[keys[i]]) {
+ return false;
+ }
+ }
+
if (place1.supplier.icon.plugin !== place2.supplier.icon.plugin)
return false;
}
@@ -270,13 +281,18 @@ TestCase {
console.log(place1.icon.plugin + " " + place2.icon.plugin);
return false;
}
- if (place1.icon.baseUrl !== place2.icon.baseUrl) {
+
+ if (place1.icon.parameters.keys().length !== place2.icon.parameters.keys().length) {
console.log("f4");
return false;
}
- if (place1.icon.fullUrl !== place2.icon.fullUrl) {
- console.log("f5");
- return false;
+
+ var keys = place1.icon.parameters.keys() + place2.icon.parameters.keys();
+ for (var i = 0; i < keys.length; ++i) {
+ if (place1.icon.parameters[keys[i]]
+ != place2.icon.parameters[keys[i]]) {
+ return false;
+ }
}
}
@@ -309,16 +325,12 @@ TestCase {
compare(emptyPlace.location.address.state, '');
compare(emptyPlace.location.address.country, '');
- compare(emptyPlace.icon.fullUrl, '');
- compare(emptyPlace.icon.baseUrl, '');
compare(emptyPlace.icon.plugin, null);
compare(emptyPlace.supplier.name, '');
compare(emptyPlace.supplier.supplierId, '');
compare(emptyPlace.supplier.url, '');
- compare(emptyPlace.supplier.icon.fullUrl, '');
- compare(emptyPlace.supplier.icon.baseUrl, '');
compare(emptyPlace.supplier.icon.plugin, null);
compare(emptyPlace.reviewModel.totalCount, -1);
@@ -525,7 +537,6 @@ TestCase {
// SignalSpy.wait() doesn't seem to work here
//signalSpy.wait();
wait(0);
-
compare(savePlace.status, Place.Error);
// try again without an invalid placeId