diff --git a/autotests/coronatest.cpp b/autotests/coronatest.cpp index 01ecb24f1..c324aae02 100644 --- a/autotests/coronatest.cpp +++ b/autotests/coronatest.cpp @@ -47,7 +47,16 @@ QRect SimpleCorona::screenGeometry(int screen) const SimpleApplet::SimpleApplet(QObject *parent , const QString &serviceId, uint appletId) : Plasma::Applet(parent, serviceId, appletId) { - updateConstraints(Plasma::Types::UiReadyConstraint); + QTime time = QTime::currentTime(); + qsrand((uint)time.msec()); + + //updateConstraints(Plasma::Types::UiReadyConstraint); + m_timer.setSingleShot(true); + m_timer.setInterval(qrand() % ((500 + 1) - 100) + 100); + m_timer.start(); + connect(&m_timer, &QTimer::timeout, [=]() { + updateConstraints(Plasma::Types::UiReadyConstraint); + }); } @@ -103,10 +112,13 @@ void CoronaTest::restore() void CoronaTest::startupCompletion() { - //startup completion signals - //QEXPECT_FAIL("", "TODO: complete startup", Continue); + QVERIFY(!m_corona->isStartupCompleted()); + QVERIFY(!m_corona->containments().first()->isUiReady()); + + QSignalSpy spy(m_corona, SIGNAL(startupCompleted())); + QVERIFY(spy.wait(1000)); + QVERIFY(m_corona->isStartupCompleted()); - //QEXPECT_FAIL("", "TODO: complete uiReady signals", Continue); QVERIFY(m_corona->containments().first()->isUiReady()); //TODO: applet creation and deletion diff --git a/autotests/coronatest.h b/autotests/coronatest.h index 8371e7b8a..607b63e06 100644 --- a/autotests/coronatest.h +++ b/autotests/coronatest.h @@ -21,6 +21,8 @@ #include +#include + #include "plasma/corona.h" #include "plasma/pluginloader.h" @@ -49,6 +51,8 @@ class SimpleApplet : public Plasma::Applet public: explicit SimpleApplet(QObject *parent = 0, const QString &serviceId = QString(), uint appletId = 0); +private: + QTimer m_timer; }; class CoronaTest : public QObject