on xenial help sign in
Wizard: skip the reporting page if the system is configured not to report crashes Fixes: #1494442

Approved by: Ken VanDine

commit95b1e3cecf039174111d2d4825b1cf102d1ab1aa authorLukáš Tinkl <lukas.tinkl@canonical.com> dateFri 2 Oct 2015, 13:23 (11 years ago) parent10540adc9588df
3 files changed+24−13
CMakeLists.txt+1−1 qml/Wizard/Pages/60-reporting.qml+10 tests/qmltests/Wizard/tst_Wizard.qml+13−12
CMakeLists.txt+1−1
@@ -57,7 +57,7 @@ find_package(Qt5DBus 5.2 REQUIRED)
5757find_package(Qt5Concurrent 5.2 REQUIRED)
5858find_package(Qt5Sql 5.2 REQUIRED)
5959
60−pkg_check_modules(APPLICATION_API REQUIRED unity-shell-application=8)
60+pkg_check_modules(APPLICATION_API REQUIRED unity-shell-application>=8)
6161
6262# Standard install paths
6363include(GNUInstallDirs)
qml/Wizard/Pages/60-reporting.qml+10
@@ -16,14 +16,24 @@
1616
1717import QtQuick 2.0
1818import Ubuntu.Components 0.1
19+import Ubuntu.SystemSettings.Diagnostics 1.0
1920import ".." as LocalComponents
2021
2122LocalComponents.Page {
23+ id: reportingPage
2224 objectName: "reportingPage"
2325
2426 title: i18n.tr("Improving your experience")
2527 forwardButtonSourceComponent: forwardButton
2628
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+
2737 Column {
2838 id: column
2939 anchors.fill: content
tests/qmltests/Wizard/tst_Wizard.qml+13−12
@@ -158,13 +158,16 @@ Item {
158158 return stack.currentPage;
159159 }
160160
161− function goToPage(name, skipSim, skipLocation) {
161+ function goToPage(name, skipSim, skipLocation, skipReporting) {
162162 if (skipSim === undefined) {
163163 skipSim = false;
164164 }
165165 if (skipLocation === undefined) {
166166 skipLocation = false;
167167 }
168+ if (skipReporting === undefined) {
169+ skipReporting = false;
170+ }
168171
169172 var page = waitForPage("languagePage");
170173 if (name === page.objectName) return page;
@@ -191,9 +194,11 @@ Item {
191194 tap(findChild(page, "forwardButton"));
192195 }
193196
194− page = waitForPage("reportingPage");
195− if (name === page.objectName) return page;
196− tap(findChild(page, "forwardButton"));
197+ if (!skipReporting) {
198+ page = waitForPage("reportingPage");
199+ if (name === page.objectName) return page;
200+ tap(findChild(page, "forwardButton"));
201+ }
197202
198203 page = waitForPage("finishedPage");
199204 if (name === page.objectName) return page;
@@ -337,8 +342,6 @@ Item {
337342 tap(findChild(page, "forwardButton"));
338343 page = waitForPage("locationPage");
339344 tap(findChild(page, "forwardButton"));
340− page = waitForPage("reportingPage");
341− tap(findChild(page, "forwardButton"));
342345 page = waitForPage("finishedPage");
343346 tap(findChild(page, "forwardButton"));
344347
@@ -390,8 +393,6 @@ Item {
390393 tap(findChild(page, "forwardButton"));
391394 page = waitForPage("locationPage");
392395 tap(findChild(page, "forwardButton"));
393− page = waitForPage("reportingPage");
394− tap(findChild(page, "forwardButton"));
395396 page = waitForPage("finishedPage");
396397 tap(findChild(page, "forwardButton"));
397398
@@ -402,7 +403,7 @@ Item {
402403 }
403404
404405 function test_passwdSwipe() {
405− goToPage(null);
406+ goToPage(null, false, false, true);
406407
407408 tryCompare(setSecuritySpy, "count", 1);
408409 compare(setSecuritySpy.signalArguments[0][0], "");
@@ -412,12 +413,12 @@ Item {
412413
413414 function test_locationSkipNoPath() {
414415 AccountsService.hereLicensePath = "";
415− goToPage("reportingPage", false, true);
416+ goToPage("finishedPage", false, true, true);
416417 }
417418
418419 function test_locationSkipNoFiles() {
419420 AccountsService.hereLicensePath = Qt.resolvedUrl("nolicenses");
420− goToPage("reportingPage", false, true);
421+ goToPage("finishedPage", false, true, true);
421422 }
422423
423424 function test_locationWaitOnPath() {
@@ -434,7 +435,7 @@ Item {
434435 compare(stack.currentPage.skipValid, false);
435436
436437 AccountsService.hereLicensePath = "";
437− waitForPage("reportingPage");
438+ waitForPage("finishedPage", false, false, true);
438439 }
439440
440441 function test_locationGpsOnly() {