on xenial help sign in
Wizard: skip the reporting page if the system is configured not to report crashes Fixes: #1494442
95b1e3cLukáš Tinkl
CMakeLists.txt+1−1
@@ -57,7 +57,7 @@ find_package(Qt5DBus 5.2 REQUIRED)
57find_package(Qt5Concurrent 5.2 REQUIRED)
57find_package(Qt5Concurrent 5.2 REQUIRED)
58find_package(Qt5Sql 5.2 REQUIRED)
58find_package(Qt5Sql 5.2 REQUIRED)
59
59
60−pkg_check_modules(APPLICATION_API REQUIRED unity-shell-application=8)
60+pkg_check_modules(APPLICATION_API REQUIRED unity-shell-application>=8)
61
61
62# Standard install paths
62# Standard install paths
63include(GNUInstallDirs)
63include(GNUInstallDirs)
qml/Wizard/Pages/60-reporting.qml+10
@@ -16,14 +16,24 @@
16
16
17import QtQuick 2.0
17import QtQuick 2.0
18import Ubuntu.Components 0.1
18import Ubuntu.Components 0.1
19+import Ubuntu.SystemSettings.Diagnostics 1.0
19import ".." as LocalComponents
20import ".." as LocalComponents
20
21
21LocalComponents.Page {
22LocalComponents.Page {
23+ id: reportingPage
22 objectName: "reportingPage"
24 objectName: "reportingPage"
23
25
24 title: i18n.tr("Improving your experience")
26 title: i18n.tr("Improving your experience")
25 forwardButtonSourceComponent: forwardButton
27 forwardButtonSourceComponent: forwardButton
26
28
29+ skipValid: false
30+ skip: !diagnostics.reportCrashes // skip the page when the system is configured not to report crashes
31+
32+ UbuntuDiagnostics {
33+ id: diagnostics
34+ Component.onCompleted: reportingPage.skipValid = true;
35+ }
36+
27 Column {
37 Column {
28 id: column
38 id: column
29 anchors.fill: content
39 anchors.fill: content
tests/qmltests/Wizard/tst_Wizard.qml+13−12
@@ -158,13 +158,16 @@ Item {
158 return stack.currentPage;
158 return stack.currentPage;
159 }
159 }
160
160
161− function goToPage(name, skipSim, skipLocation) {
161+ function goToPage(name, skipSim, skipLocation, skipReporting) {
162 if (skipSim === undefined) {
162 if (skipSim === undefined) {
163 skipSim = false;
163 skipSim = false;
164 }
164 }
165 if (skipLocation === undefined) {
165 if (skipLocation === undefined) {
166 skipLocation = false;
166 skipLocation = false;
167 }
167 }
168+ if (skipReporting === undefined) {
169+ skipReporting = false;
170+ }
168
171
169 var page = waitForPage("languagePage");
172 var page = waitForPage("languagePage");
170 if (name === page.objectName) return page;
173 if (name === page.objectName) return page;
@@ -191,9 +194,11 @@ Item {
191 tap(findChild(page, "forwardButton"));
194 tap(findChild(page, "forwardButton"));
192 }
195 }
193
196
197+ if (!skipReporting) {
194− page = waitForPage("reportingPage");
198+ page = waitForPage("reportingPage");
195− if (name === page.objectName) return page;
199+ if (name === page.objectName) return page;
196− tap(findChild(page, "forwardButton"));
200+ tap(findChild(page, "forwardButton"));
201+ }
197
202
198 page = waitForPage("finishedPage");
203 page = waitForPage("finishedPage");
199 if (name === page.objectName) return page;
204 if (name === page.objectName) return page;
@@ -337,8 +342,6 @@ Item {
337 tap(findChild(page, "forwardButton"));
342 tap(findChild(page, "forwardButton"));
338 page = waitForPage("locationPage");
343 page = waitForPage("locationPage");
339 tap(findChild(page, "forwardButton"));
344 tap(findChild(page, "forwardButton"));
340− page = waitForPage("reportingPage");
341− tap(findChild(page, "forwardButton"));
342 page = waitForPage("finishedPage");
345 page = waitForPage("finishedPage");
343 tap(findChild(page, "forwardButton"));
346 tap(findChild(page, "forwardButton"));
344
347
@@ -390,8 +393,6 @@ Item {
390 tap(findChild(page, "forwardButton"));
393 tap(findChild(page, "forwardButton"));
391 page = waitForPage("locationPage");
394 page = waitForPage("locationPage");
392 tap(findChild(page, "forwardButton"));
395 tap(findChild(page, "forwardButton"));
393− page = waitForPage("reportingPage");
394− tap(findChild(page, "forwardButton"));
395 page = waitForPage("finishedPage");
396 page = waitForPage("finishedPage");
396 tap(findChild(page, "forwardButton"));
397 tap(findChild(page, "forwardButton"));
397
398
@@ -402,7 +403,7 @@ Item {
402 }
403 }
403
404
404 function test_passwdSwipe() {
405 function test_passwdSwipe() {
405− goToPage(null);
406+ goToPage(null, false, false, true);
406
407
407 tryCompare(setSecuritySpy, "count", 1);
408 tryCompare(setSecuritySpy, "count", 1);
408 compare(setSecuritySpy.signalArguments[0][0], "");
409 compare(setSecuritySpy.signalArguments[0][0], "");
@@ -412,12 +413,12 @@ Item {
412
413
413 function test_locationSkipNoPath() {
414 function test_locationSkipNoPath() {
414 AccountsService.hereLicensePath = "";
415 AccountsService.hereLicensePath = "";
415− goToPage("reportingPage", false, true);
416+ goToPage("finishedPage", false, true, true);
416 }
417 }
417
418
418 function test_locationSkipNoFiles() {
419 function test_locationSkipNoFiles() {
419 AccountsService.hereLicensePath = Qt.resolvedUrl("nolicenses");
420 AccountsService.hereLicensePath = Qt.resolvedUrl("nolicenses");
420− goToPage("reportingPage", false, true);
421+ goToPage("finishedPage", false, true, true);
421 }
422 }
422
423
423 function test_locationWaitOnPath() {
424 function test_locationWaitOnPath() {
@@ -434,7 +435,7 @@ Item {
434 compare(stack.currentPage.skipValid, false);
435 compare(stack.currentPage.skipValid, false);
435
436
436 AccountsService.hereLicensePath = "";
437 AccountsService.hereLicensePath = "";
437− waitForPage("reportingPage");
438+ waitForPage("finishedPage", false, false, true);
438 }
439 }
439
440
440 function test_locationGpsOnly() {
441 function test_locationGpsOnly() {