on xenial help sign in
more test fixes
commit063f167b315343fdc064263ff5d9a78ed89a396a authorNick Dedekind <nicholas.dedekind@gmail.com> dateWed 27 Aug 2014, 17:12 (12 years ago) parentd450385
3 files changed+40−22
tests/mocks/Unity/Application/ApplicationInfo.h+1 tests/mocks/Unity/Application/ApplicationManager.cpp+34−17 tests/qmltests/Stages/tst_ApplicationWindow.qml+5−5
tests/mocks/Unity/Application/ApplicationInfo.h+1
@@ -49,6 +49,7 @@ public:
4949 void setIconId(const QString &iconId);
5050 void setScreenshotId(const QString &screenshotId);
5151
52+ void setAppId(const QString &value) { m_appId = value; }
5253 QString appId() const override { return m_appId; }
5354
5455 void setName(const QString &value);
tests/mocks/Unity/Application/ApplicationManager.cpp+34−17
@@ -336,104 +336,121 @@ void ApplicationManager::buildListOfAvailableApplications()
336336{
337337 ApplicationInfo *application;
338338
339− application = new ApplicationInfo("unity8-dash", this);
339+ application = new ApplicationInfo(this);
340+ application->setAppId("unity8-dash");
340341 application->setName("Unity 8 Mock Dash");
341342 application->setScreenshotId("unity8-dash");
342343 application->setStage(ApplicationInfo::MainStage);
343344 m_availableApplications.append(application);
344345
345− application = new ApplicationInfo("dialer-app", this);
346+ application = new ApplicationInfo(this);
347+ application->setAppId("dialer-app");
346348 application->setName("Dialer");
347349 application->setScreenshotId("dialer");
348350 application->setIconId("dialer-app");
349351 application->setStage(ApplicationInfo::SideStage);
350352 m_availableApplications.append(application);
351353
352− application = new ApplicationInfo("camera-app", this);
354+ application = new ApplicationInfo(this);
355+ application->setAppId("camera-app");
353356 application->setName("Camera");
354357 application->setScreenshotId("camera");
355358 application->setIconId("camera");
356359 application->setFullscreen(true);
357360 m_availableApplications.append(application);
358361
359− application = new ApplicationInfo("gallery-app", this);
362+ application = new ApplicationInfo(this);
363+ application->setAppId("gallery-app");
360364 application->setName("Gallery");
361365 application->setScreenshotId("gallery");
362366 application->setIconId("gallery");
363367 application->setFullscreen(true);
364368 m_availableApplications.append(application);
365369
366− application = new ApplicationInfo("facebook-webapp", this);
370+ application = new ApplicationInfo(this);
371+ application->setAppId("facebook-webapp");
367372 application->setName("Facebook");
368373 application->setScreenshotId("facebook");
369374 application->setIconId("facebook");
370375 application->setStage(ApplicationInfo::SideStage);
371376 m_availableApplications.append(application);
372377
373− application = new ApplicationInfo("webbrowser-app", this);
378+ application = new ApplicationInfo(this);
379+ application->setAppId("webbrowser-app");
374380 application->setFullscreen(true);
375381 application->setName("Browser");
376382 application->setScreenshotId("browser");
377383 application->setIconId("browser");
378384 m_availableApplications.append(application);
379385
380− application = new ApplicationInfo("twitter-webapp", this);
386+ application = new ApplicationInfo(this);
387+ application->setAppId("twitter-webapp");
381388 application->setName("Twitter");
382389 application->setScreenshotId("twitter");
383390 application->setIconId("twitter");
384391 application->setStage(ApplicationInfo::SideStage);
385392 m_availableApplications.append(application);
386393
387− application = new ApplicationInfo("map", this);
394+ application = new ApplicationInfo(this);
395+ application->setAppId("map");
388396 application->setName("Map");
389397 application->setIconId("map");
390398 application->setScreenshotId("map");
391399 m_availableApplications.append(application);
392400
393− application = new ApplicationInfo("gmail-webapp", this);
401+ application = new ApplicationInfo(this);
402+ application->setAppId("gmail-webapp");
394403 application->setName("GMail");
395404 application->setIconId("gmail");
396405 m_availableApplications.append(application);
397406
398− application = new ApplicationInfo("ubuntu-weather-app", this);
407+ application = new ApplicationInfo(this);
408+ application->setAppId("ubuntu-weather-app");
399409 application->setName("Weather");
400410 application->setIconId("weather");
401411 application->setStage(ApplicationInfo::SideStage);
402412 m_availableApplications.append(application);
403413
404− application = new ApplicationInfo("notes-app", this);
414+ application = new ApplicationInfo(this);
415+ application->setAppId("notes-app");
405416 application->setName("Notepad");
406417 application->setIconId("notepad");
407418 application->setStage(ApplicationInfo::SideStage);
408419 m_availableApplications.append(application);
409420
410− application = new ApplicationInfo("calendar-app", this);
421+ application = new ApplicationInfo(this);
422+ application->setAppId("calendar-app");
411423 application->setName("Calendar");
412424 application->setIconId("calendar");
413425 application->setStage(ApplicationInfo::SideStage);
414426 m_availableApplications.append(application);
415427
416− application = new ApplicationInfo("evernote", this);
428+ application = new ApplicationInfo(this);
429+ application->setAppId("evernote");
417430 application->setName("Evernote");
418431 application->setIconId("evernote");
419432 m_availableApplications.append(application);
420433
421− application = new ApplicationInfo("pinterest", this);
434+ application = new ApplicationInfo(this);
435+ application->setAppId("pinterest");
422436 application->setName("Pinterest");
423437 application->setIconId("pinterest");
424438 m_availableApplications.append(application);
425439
426− application = new ApplicationInfo("soundcloud", this);
440+ application = new ApplicationInfo(this);
441+ application->setAppId("soundcloud");
427442 application->setName("SoundCloud");
428443 application->setIconId("soundcloud");
429444 m_availableApplications.append(application);
430445
431− application = new ApplicationInfo("wikipedia", this);
446+ application = new ApplicationInfo(this);
447+ application->setAppId("wikipedia");
432448 application->setName("Wikipedia");
433449 application->setIconId("wikipedia");
434450 m_availableApplications.append(application);
435451
436− application = new ApplicationInfo("youtube", this);
452+ application = new ApplicationInfo(this);
453+ application->setAppId("youtube");
437454 application->setName("YouTube");
438455 application->setIconId("youtube");
439456 m_availableApplications.append(application);
tests/qmltests/Stages/tst_ApplicationWindow.qml+5−5
@@ -38,9 +38,9 @@ Rectangle {
3838 readonly property var fakeSession: fakeApplication ? fakeApplication.session : null
3939
4040 Connections {
41− target: fakeSession
42− onSurfaceChanged: {
43− surfaceCheckbox.checked = fakeSession.surface !== null;
41+ target: fakeApplication
42+ onSessionChanged: {
43+ surfaceCheckbox.checked = fakeApplication.session !== null
4444 }
4545 }
4646
@@ -262,14 +262,14 @@ Rectangle {
262262
263263 tryCompare(stateGroup, "state", "screenshot");
264264 waitUntilTransitionsEnd();
265− tryCompare(fakeSession, "surface", null);
265+ tryCompare(fakeApplication, "session", null);
266266
267267 // and restart it
268268 setApplicationState(appStarting);
269269
270270 waitUntilTransitionsEnd();
271271 verify(stateGroup.state === "screenshot");
272− verify(fakeSession.surface === null);
272+ verify(fakeSession === null);
273273
274274 setApplicationState(appRunning);
275275