@@ -18,6 +18,7 @@ import QtQuick 2.3
18import QtTest 1.0
18import QtTest 1.0
19import AccountsService 0.1
19import AccountsService 0.1
20import MeeGo.QOfono 0.2
20import MeeGo.QOfono 0.2
21import Ubuntu.Components 1.1
22import Ubuntu.Components 1.1
22import Ubuntu.SystemSettings.SecurityPrivacy 1.0
23import Ubuntu.SystemSettings.SecurityPrivacy 1.0
23import Unity.Test 0.1 as UT
24import Unity.Test 0.1 as UT
@@ -58,6 +59,16 @@ Item {
58 signalName: "setSecurityCalled"
59 signalName: "setSecurityCalled"
63+ id: activateLocationSpy
64+ signalName: "activated"
69+ signalName: "activated"
61 function setup() {
72 function setup() {
62 AccountsService.hereEnabled = false;
73 AccountsService.hereEnabled = false;
63 AccountsService.hereLicensePath = Qt.resolvedUrl("licenses");
74 AccountsService.hereLicensePath = Qt.resolvedUrl("licenses");
@@ -68,6 +79,19 @@ Item {
69 updateSessionLanguageSpy.clear();
80 updateSessionLanguageSpy.clear();
70 setSecuritySpy.clear();
81 setSecuritySpy.clear();
82+ activateLocationSpy.clear();
83+ activateGPSSpy.clear();
86+ "location-detection-enabled": {
90+ "gps-detection-enabled": {
73 Component.onCompleted: {
97 Component.onCompleted: {
@@ -360,8 +384,8 @@ Item {
360 var nopeCheck = findChild(page, "nopeCheck");
384 var nopeCheck = findChild(page, "nopeCheck");
362 var locationActionGroup = findInvisibleChild(page, "locationActionGroup");
386 var locationActionGroup = findInvisibleChild(page, "locationActionGroup");
363− tryCompare(locationActionGroup.location, "state", false);
387+ activateLocationSpy.target = locationActionGroup.location;
364− tryCompare(locationActionGroup.gps, "state", false);
388+ activateGPSSpy.target = locationActionGroup.gps;
366 tap(gpsCheck);
390 tap(gpsCheck);
367 tryCompare(gpsCheck, "checked", true);
391 tryCompare(gpsCheck, "checked", true);
@@ -370,8 +394,8 @@ Item {
371 tap(findChild(page, "forwardButton"));
395 tap(findChild(page, "forwardButton"));
372 tryCompare(AccountsService, "hereEnabled", false);
396 tryCompare(AccountsService, "hereEnabled", false);
373− tryCompare(locationActionGroup.location, "state", true);
397+ tryCompare(activateLocationSpy, "count", 1)
374− tryCompare(locationActionGroup.gps, "state", true);
398+ tryCompare(activateGPSSpy, "count", 1)
377 function test_locationNope() {
401 function test_locationNope() {
@@ -381,8 +405,8 @@ Item {
381 var nopeCheck = findChild(page, "nopeCheck");
405 var nopeCheck = findChild(page, "nopeCheck");
383 var locationActionGroup = findInvisibleChild(page, "locationActionGroup");
407 var locationActionGroup = findInvisibleChild(page, "locationActionGroup");
384− tryCompare(locationActionGroup.location, "state", false);
408+ activateLocationSpy.target = locationActionGroup.location;
385− tryCompare(locationActionGroup.gps, "state", false);
409+ activateGPSSpy.target = locationActionGroup.gps;
387 tap(nopeCheck);
411 tap(nopeCheck);
388 tryCompare(gpsCheck, "checked", false);
412 tryCompare(gpsCheck, "checked", false);
@@ -391,8 +415,8 @@ Item {
392 tap(findChild(page, "forwardButton"));
416 tap(findChild(page, "forwardButton"));
393 tryCompare(AccountsService, "hereEnabled", false);
417 tryCompare(AccountsService, "hereEnabled", false);
394− tryCompare(locationActionGroup.location, "state", false);
418+ tryCompare(activateLocationSpy, "count", 0)
395− tryCompare(locationActionGroup.gps, "state", false);
419+ tryCompare(activateGPSSpy, "count", 0)
398 function test_locationHere() {
422 function test_locationHere() {
@@ -402,8 +426,8 @@ Item {
402 var nopeCheck = findChild(page, "nopeCheck");
426 var nopeCheck = findChild(page, "nopeCheck");
404 var locationActionGroup = findInvisibleChild(page, "locationActionGroup");
428 var locationActionGroup = findInvisibleChild(page, "locationActionGroup");
405− tryCompare(locationActionGroup.location, "state", false);
429+ activateLocationSpy.target = locationActionGroup.location;
406− tryCompare(locationActionGroup.gps, "state", false);
430+ activateGPSSpy.target = locationActionGroup.gps;
408 // no tap because HERE is the default
432 // no tap because HERE is the default
409 tryCompare(gpsCheck, "checked", false);
433 tryCompare(gpsCheck, "checked", false);
@@ -412,8 +436,8 @@ Item {
413 tap(findChild(page, "forwardButton"));
437 tap(findChild(page, "forwardButton"));
414 tryCompare(AccountsService, "hereEnabled", true);
438 tryCompare(AccountsService, "hereEnabled", true);
415− tryCompare(locationActionGroup.location, "state", true);
439+ tryCompare(activateLocationSpy, "count", 1)
416− tryCompare(locationActionGroup.gps, "state", true);
440+ tryCompare(activateGPSSpy, "count", 1)
419 function test_locationHereTerms() {
443 function test_locationHereTerms() {