@@ -56,6 +56,15 @@ ApplicationManager::ApplicationManager(QObject *parent)
5656 Q_ASSERT(MirFocusController::instance());
5757 connect(MirFocusController::instance(), &MirFocusController::focusedSurfaceChanged,
5858 this, &ApplicationManager::updateFocusedApplication, Qt::QueuedConnection);
59+
60+
61+ // Emit signal to notify Upstart that Mir is ready to receive client connections
62+ // see http://upstart.ubuntu.com/cookbook/#expect-stop
63+ // We do ths because some autopilot tests actually use this mock Unity.Application module,
64+ // so we have to mimic what the real ApplicationManager does in that regard.
65+ if (qgetenv("UNITY_MIR_EMITS_SIGSTOP") == "1") {
66+ raise(SIGSTOP);
67+ }
5968}
6069
6170ApplicationManager::~ApplicationManager()