mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-01-20 13:18:06 +00:00
fix(tests/self-test): fix test for mac os
This commit is contained in:
parent
e35927d1fd
commit
55b07cb119
7 changed files with 21 additions and 8 deletions
|
|
@ -63,6 +63,8 @@ CoreManager::CoreManager (QObject *parent, const QString &configPath) :
|
|||
mInstance->mSettingsModel = new SettingsModel(mInstance);
|
||||
mInstance->mAccountSettingsModel = new AccountSettingsModel(mInstance);
|
||||
|
||||
mInstance->mStarted = true;
|
||||
|
||||
emit mInstance->coreStarted();
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -47,6 +47,10 @@ class CoreManager : public QObject {
|
|||
public:
|
||||
~CoreManager () = default;
|
||||
|
||||
bool started () const {
|
||||
return mStarted;
|
||||
}
|
||||
|
||||
std::shared_ptr<linphone::Core> getCore () {
|
||||
Q_CHECK_PTR(mCore);
|
||||
return mCore;
|
||||
|
|
@ -151,6 +155,8 @@ private:
|
|||
std::shared_ptr<linphone::Core> mCore;
|
||||
std::shared_ptr<CoreHandlers> mHandlers;
|
||||
|
||||
bool mStarted = false;
|
||||
|
||||
CallsListModel *mCallsListModel = nullptr;
|
||||
ContactsListModel *mContactsListModel = nullptr;
|
||||
SipAddressesModel *mSipAddressesModel = nullptr;
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ void MainViewTest::showManageAccountsPopup () {
|
|||
|
||||
QVERIFY(virtualWindowContent);
|
||||
QVERIFY(!strncmp(virtualWindowContent->metaObject()->className(), name, sizeof name - 1));
|
||||
QCOMPARE(virtualWindowContent->objectName(), QStringLiteral("manageAccounts"));
|
||||
QCOMPARE(virtualWindowContent->objectName(), QStringLiteral("__manageAccounts"));
|
||||
|
||||
// Close popup.
|
||||
QTest::mouseClick(mainWindow, Qt::LeftButton, Qt::KeyboardModifiers(), QPoint(476, 392));
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@
|
|||
* Author: Ronan Abhamon
|
||||
*/
|
||||
|
||||
#include <QQmlProperty>
|
||||
#include <QSignalSpy>
|
||||
#include <QTest>
|
||||
|
||||
|
|
@ -32,12 +33,16 @@
|
|||
// =============================================================================
|
||||
|
||||
void SelfTest::checkAppStartup () {
|
||||
QSignalSpy spyCoreStarted(CoreManager::getInstance()->getHandlers().get(), &CoreHandlers::coreStarted);
|
||||
QSignalSpy spyLoaderReady(TestUtils::getMainLoaderFromMainWindow(), SIGNAL(loaded()));
|
||||
CoreManager *coreManager = CoreManager::getInstance();
|
||||
QQuickItem *mainLoader = TestUtils::getMainLoaderFromMainWindow();
|
||||
|
||||
QVERIFY(spyCoreStarted.wait(5000));
|
||||
QSignalSpy spyCoreStarted(coreManager->getHandlers().get(), &CoreHandlers::coreStarted);
|
||||
QSignalSpy spyLoaderReady(mainLoader, SIGNAL(loaded()));
|
||||
|
||||
if (spyLoaderReady.count() != 1)
|
||||
if (!coreManager->started())
|
||||
QVERIFY(spyCoreStarted.wait(5000));
|
||||
|
||||
if (!QQmlProperty::read(mainLoader, "item").value<QObject *>())
|
||||
QVERIFY(spyLoaderReady.wait(1000));
|
||||
|
||||
QVERIFY(QTest::qWaitForWindowExposed(App::getInstance()->getMainWindow()));
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ Item {
|
|||
id: window
|
||||
|
||||
// Used for internal purposes only. Like Notifications.
|
||||
objectName: 'internalWindow'
|
||||
objectName: '__internalWindow'
|
||||
|
||||
flags: wrapper.flags
|
||||
opacity: 0
|
||||
|
|
|
|||
|
|
@ -39,6 +39,6 @@ TestCase {
|
|||
var window = notification.data[0]
|
||||
|
||||
compare(Utils.qmlTypeof(window, 'QQuickWindowQmlImpl'), true)
|
||||
compare(window.objectName === 'internalWindow', true)
|
||||
compare(window.objectName === '__internalWindow', true)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ DialogPlus {
|
|||
]
|
||||
|
||||
centeredButtons: true
|
||||
objectName: 'manageAccounts'
|
||||
objectName: '__manageAccounts'
|
||||
|
||||
height: ManageAccountsStyle.height
|
||||
width: ManageAccountsStyle.width
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue