diff options
author | Paolo Angelelli <paolo.angelelli@qt.io> | 2017-09-11 16:02:55 +0200 |
---|---|---|
committer | Paolo Angelelli <paolo.angelelli@qt.io> | 2017-09-11 16:03:23 +0200 |
commit | 5f26c3afbacd370eca53692eb3c9327c072d5fcf (patch) | |
tree | 1a875cee2fa1a85f9b61143875f72f5c8a7259b5 /tests | |
parent | 8ac6377e62af803b567449cdf30c669b92114cc4 (diff) | |
parent | dcc9ec9e9ab3eaada5c68896833c14f905084922 (diff) | |
download | qtlocation-5f26c3afbacd370eca53692eb3c9327c072d5fcf.tar.gz |
Merge remote-tracking branch 'origin/dev' into wip/navigation
Change-Id: I764e0c54168b4d4f4fc029d69a10e915332c457d
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/auto.pro | 3 | ||||
-rw-r--r-- | tests/auto/declarative_core/tst_plugin.qml | 7 | ||||
-rw-r--r-- | tests/auto/declarative_ui/tst_map.qml | 24 | ||||
-rw-r--r-- | tests/auto/declarative_ui/tst_map_flick.qml | 12 | ||||
-rw-r--r-- | tests/auto/geotestplugin/qgeotiledmappingmanagerengine_test.h | 7 | ||||
-rw-r--r-- | tests/auto/nokia_services/routing/tst_routing.cpp | 3 | ||||
-rw-r--r-- | tests/auto/qgeotiledmap/tst_qgeotiledmap.cpp | 6 |
7 files changed, 51 insertions, 11 deletions
diff --git a/tests/auto/auto.pro b/tests/auto/auto.pro index d97af779..1229874a 100644 --- a/tests/auto/auto.pro +++ b/tests/auto/auto.pro @@ -62,9 +62,6 @@ qtHaveModule(location) { declarative_geoshape !mac: SUBDIRS += declarative_ui - - # QTBUG-60268 - boot2qt: SUBDIRS -= declarative_ui } } diff --git a/tests/auto/declarative_core/tst_plugin.qml b/tests/auto/declarative_core/tst_plugin.qml index 3dabba07..7b880f1d 100644 --- a/tests/auto/declarative_core/tst_plugin.qml +++ b/tests/auto/declarative_core/tst_plugin.qml @@ -99,9 +99,14 @@ Item { verify(invalidPlugin.supportsRouting()) verify(invalidPlugin.supportsPlaces()) - invalidPlugin.name = '' + invalidPlugin.name = 'here' compare(invalidAttachedSpy.count, 2) + verify(invalidPlugin.supportsMapping(Plugin.OnlineMappingFeature)) + verify(invalidPlugin.supportsGeocoding(Plugin.OnlineGeocodingFeature)) + verify(invalidPlugin.supportsRouting(Plugin.OnlineRoutingFeature)) + invalidPlugin.name = '' + compare(invalidAttachedSpy.count, 2) verify(!invalidPlugin.supportsMapping()) verify(!invalidPlugin.supportsGeocoding()) verify(!invalidPlugin.supportsRouting()) diff --git a/tests/auto/declarative_ui/tst_map.qml b/tests/auto/declarative_ui/tst_map.qml index a6c10c22..52dcac11 100644 --- a/tests/auto/declarative_ui/tst_map.qml +++ b/tests/auto/declarative_ui/tst_map.qml @@ -50,6 +50,20 @@ Item { } ] } + Plugin { + id: testPluginLazyParameter; + name: "qmlgeo.test.plugin" + allowExperimental: true + property string extraTypeName : undefined + PluginParameter { name: "supported"; value: true} + PluginParameter { name: "finishRequestImmediately"; value: true} + PluginParameter { name: "validateWellKnownValues"; value: true} + PluginParameter { name: "extraMapTypeName"; value: testPluginLazyParameter.extraTypeName} + + Component.onCompleted: { + extraTypeName = "SomeString" + } + } property variant coordinate1: QtPositioning.coordinate(10, 11) property variant coordinate2: QtPositioning.coordinate(12, 13) @@ -106,6 +120,11 @@ Item { Map {id: mapTiltBearingHere; plugin: herePlugin; center: coordinate1; width: 1000; height: 1000; zoomLevel: 4; bearing: 45.0; tilt: 25.0 } + Map { + id: mapWithLazyPlugin + plugin: testPluginLazyParameter + } + MapParameter { id: testParameter type: "cameraCenter_test" @@ -129,6 +148,11 @@ Item { mapCenterSpy.clear(); } + function test_lazy_parameter() { + compare(mapWithLazyPlugin.supportedMapTypes.length, 5) + compare(mapWithLazyPlugin.supportedMapTypes[4].name, "SomeString") + } + function test_map_center() { // coordinate is set at map element declaration compare(map.center.latitude, 10) diff --git a/tests/auto/declarative_ui/tst_map_flick.qml b/tests/auto/declarative_ui/tst_map_flick.qml index c153411f..ba10d12e 100644 --- a/tests/auto/declarative_ui/tst_map_flick.qml +++ b/tests/auto/declarative_ui/tst_map_flick.qml @@ -170,7 +170,7 @@ Item { map.center.longitude = 11 mousePress(page, 0, 50) for (var i = 0; i < 50; i += 5) { - wait(20) + wait(25) mouseMove(page, 0, (50 + i), 0, Qt.LeftButton); } mouseRelease(page, 0, 100) @@ -207,7 +207,7 @@ Item { map.center.longitude = 11 mousePress(page, 10, 95) for (var i = 45; i > 0; i -= 5) { - wait(20) + wait(25) mouseMove(page, 10, (50 + i), 0, Qt.LeftButton); } mouseRelease(page, 10, 50) @@ -242,7 +242,7 @@ Item { mousePress(page, pos, pos) for (var i = pos; i < 50; i += 5) { pos = i - wait(20) + wait(25) mouseMove(page, pos, pos, 0, Qt.LeftButton); } mouseRelease(page, pos, pos) @@ -263,7 +263,7 @@ Item { map.center.longitude = 50 mousePress(page, 0, 0) for (var i = 0; i < 50; i += 5) { - wait(20) + wait(25) mouseMove(page, i, i, 0, Qt.LeftButton); } mouseRelease(page, 50, 50) @@ -290,7 +290,7 @@ Item { map.center.longitude = 50 mousePress(page, 0, 0) for (var i = 0; i < 50; i += 5) { - wait(20) + wait(25) mouseMove(page, i, i, 0, Qt.LeftButton); } mouseRelease(page, 50, 50) @@ -324,7 +324,7 @@ Item { map.center.longitude = 50 mousePress(page, 0, 0) for (var i = 0; i < 50; i += 5) { - wait(20) + wait(25) mouseMove(page, i, i, 0, Qt.LeftButton); } mouseRelease(page, 50, 50) diff --git a/tests/auto/geotestplugin/qgeotiledmappingmanagerengine_test.h b/tests/auto/geotestplugin/qgeotiledmappingmanagerengine_test.h index 0a7624ee..297be0d5 100644 --- a/tests/auto/geotestplugin/qgeotiledmappingmanagerengine_test.h +++ b/tests/auto/geotestplugin/qgeotiledmappingmanagerengine_test.h @@ -64,6 +64,7 @@ public: const QByteArray pluginName = "qmlgeo.test.plugin"; QList<QGeoMapType> mapTypes; + mapTypes << QGeoMapType(QGeoMapType::StreetMap, tr("StreetMap"), tr("StreetMap"), false, false, 1, pluginName, capabilities); mapTypes << QGeoMapType(QGeoMapType::SatelliteMapDay, tr("SatelliteMapDay"), tr("SatelliteMapDay"), false, false, 2, pluginName, capabilities); mapTypes << QGeoMapType(QGeoMapType::CycleMap, tr("CycleMap"), tr("CycleMap"), false, false, 3, pluginName, capabilities); @@ -80,6 +81,12 @@ public: QVariantMap meta; meta["foo"] = 42; mapTypes << QGeoMapType(QGeoMapType::CustomMap, tr("AlternateCameraCapabilities"), tr("AlternateCameraCapabilities"), false, false, 4, pluginName, capabilities4, meta); + + if (parameters.contains(QStringLiteral("extraMapTypeName"))) { + QString extraMapTypeName = parameters.value(QStringLiteral("extraMapTypeName")).toString(); + mapTypes << QGeoMapType(QGeoMapType::CustomMap, extraMapTypeName, extraMapTypeName, false, false, 5, pluginName, capabilities); + } + setSupportedMapTypes(mapTypes); QGeoTileFetcherTest *fetcher = new QGeoTileFetcherTest(this); diff --git a/tests/auto/nokia_services/routing/tst_routing.cpp b/tests/auto/nokia_services/routing/tst_routing.cpp index c214556f..833c95af 100644 --- a/tests/auto/nokia_services/routing/tst_routing.cpp +++ b/tests/auto/nokia_services/routing/tst_routing.cpp @@ -234,7 +234,8 @@ void tst_nokia_routing::calculateRoute() m_routingManager->calculateRoute(m_dummyRequest); m_replyUnowned->complete(); m_replyUnowned = 0; - QTRY_VERIFY_WITH_TIMEOUT(m_calculationDone, 100); + // Timeout of 200ms is required for slow targets (e.g. Qemu) + QTRY_VERIFY_WITH_TIMEOUT(m_calculationDone, 200); } void tst_nokia_routing::onReply(QGeoRouteReply* reply) diff --git a/tests/auto/qgeotiledmap/tst_qgeotiledmap.cpp b/tests/auto/qgeotiledmap/tst_qgeotiledmap.cpp index 7eb1ed51..14b40eb6 100644 --- a/tests/auto/qgeotiledmap/tst_qgeotiledmap.cpp +++ b/tests/auto/qgeotiledmap/tst_qgeotiledmap.cpp @@ -134,6 +134,8 @@ void tst_QGeoTiledMap::fetchTiles() //prev_visible camera.setZoomLevel(zoomLevel-1); + // Delay needed on slow targets (e.g. Qemu) + QTest::qWait(10); m_map->clearData(); m_tilesCounter->m_tiles.clear(); m_map->setCameraData(camera); @@ -142,6 +144,8 @@ void tst_QGeoTiledMap::fetchTiles() //visible + prefetch camera.setZoomLevel(zoomLevel); + // Delay needed on slow targets (e.g. Qemu) + QTest::qWait(10); m_map->clearData(); m_tilesCounter->m_tiles.clear(); m_map->setCameraData(camera); @@ -155,6 +159,8 @@ void tst_QGeoTiledMap::fetchTiles() //next visible camera.setZoomLevel(zoomLevel + 1); + // Delay needed on slow targets (e.g. Qemu) + QTest::qWait(10); m_map->clearData(); m_tilesCounter->m_tiles.clear(); m_map->setCameraData(camera); |