on xenial help sign in
Remove useless try/catch here.
521e020Rodney Dawes
tests/utils/modules/Unity/Test/StageTestCase.qml+14−18
@@ -42,27 +42,23 @@ UnityTestCase {
42 Returns the appDelegate of the first surface created by the app with the specified appId
42 Returns the appDelegate of the first surface created by the app with the specified appId
43 */
43 */
44 function startApplication(appId) {
44 function startApplication(appId) {
45− try {
46− var app = ApplicationManager.findApplication(appId);
45+ var app = ApplicationManager.findApplication(appId);
47− if (app) {
46+ if (app) {
48− for (var i = 0; i < topLevelSurfaceList.count; i++) {
47+ for (var i = 0; i < topLevelSurfaceList.count; i++) {
49− if (topLevelSurfaceList.applicationAt(i).appId === appId) {
48+ if (topLevelSurfaceList.applicationAt(i).appId === appId) {
50− var appRepeater = findChild(stage, "appRepeater");
49+ var appRepeater = findChild(stage, "appRepeater");
51− verify(appRepeater);
50+ verify(appRepeater);
52− return appRepeater.itemAt(i);
51+ return appRepeater.itemAt(i);
53− }
54 }
52 }
55 }
53 }
54+ }
56
55
57− var surfaceId = topLevelSurfaceList.nextId;
56+ var surfaceId = topLevelSurfaceList.nextId;
58− app = ApplicationManager.startApplication(appId);
57+ app = ApplicationManager.startApplication(appId);
59− verify(app);
58+ verify(app);
60− waitUntilAppWindowIsFullyLoaded(surfaceId);
59+ waitUntilAppWindowIsFullyLoaded(surfaceId);
61− compare(app.surfaceList.count, 1);
60+ compare(app.surfaceList.count, 1);
62
61
63− return findChild(stage, "appDelegate_" + surfaceId);
62+ return findChild(stage, "appDelegate_" + surfaceId);
64− } catch(err) {
65− throw new Error("startApplication("+appId+") called from line " + util.callerLine(1) + " failed!");
66− }
67 }
63 }
68}
64}