on xenial help sign in
Search dialogs for the modeSwitchWarningDialog

Instead of searching root for the dialog we expect to not find, search dialogs. The search space is way smaller. Shaves about 1 minute off the tests on an unloaded Ryzen 7 1700.

commit7f2de6db49e1ed20fe60b5b608c349cdeb0102ec authorDalton Durst <dalton@ubports.com> dateFri 13 Dec 2019, 14:39 (7 years ago) parent5e3b45c
1 file changed+4−4
tests/qmltests/tst_Shell.qml+4−4
tests/qmltests/tst_Shell.qml+4−4
@@ -2114,7 +2114,7 @@ Rectangle {
21142114 {tag: "forceClose", replug: false, tabletMode: false, screenSize: Qt.size(units.gu(20), units.gu(40)) },
21152115 {tag: "replug", replug: true, tabletMode: false, screenSize: Qt.size(units.gu(20), units.gu(40)) },
21162116 {tag: "forceClose+tablet", replug: false, tabletMode: true, screenSize: Qt.size(units.gu(90), units.gu(65)) },
2117− {tag: "replug+tablet", replug: true, tabletMode: true, screenSize: Qt.size(units.gu(90), units.gu(65)) }
2117+ {tag: "replug+tablet", replug: true, tabletMode: true, screenSize: Qt.size(units.gu(90), units.gu(65)) },
21182118 ];
21192119 }
21202120
@@ -2134,7 +2134,7 @@ Rectangle {
21342134 waitForRendering(shell);
21352135
21362136 // No legacy app running yet... Popup must *not* show.
2137− var popup = findChild(root, "modeSwitchWarningDialog");
2137+ var popup = findChild(dialogs, "modeSwitchWarningDialog");
21382138 compare(popup, null);
21392139
21402140 shell.usageScenario = "desktop"
@@ -2147,7 +2147,7 @@ Rectangle {
21472147 waitForRendering(shell);
21482148
21492149 // The popup must appear now, unless in "tablet" mode
2150− popup = findChild(root, "modeSwitchWarningDialog");
2150+ popup = findChild(dialogs, "modeSwitchWarningDialog");
21512151 if (data.tabletMode) {
21522152 verify(!popup);
21532153 } else {
@@ -2164,7 +2164,7 @@ Rectangle {
21642164 }
21652165
21662166 // Popup must be gone now
2167− popup = findChild(root, "modeSwitchWarningDialog");
2167+ popup = findChild(dialogs, "modeSwitchWarningDialog");
21682168 tryCompareFunction(function() { return popup === null}, true);
21692169
21702170 if (data.replug || data.tabletMode) {