feat(Notifications/Notification): add spec file

This commit is contained in:
Ronan Abhamon 2016-11-16 14:07:13 +01:00
parent 91bb74c218
commit fbfa00a3de
3 changed files with 38 additions and 1 deletions

View file

@ -112,7 +112,7 @@ void Notifier::showCallMessage (
);
// Destroy it after timeout.
QTimer::singleShot(timeout, this, [object,this]() {
QTimer::singleShot(timeout, this, [object, this]() {
delete object;
m_mutex.lock();

View file

@ -0,0 +1,25 @@
import QtTest 1.1
import Linphone 1.0
import Utils 1.0
// ===================================================================
// Check defined properties/methods used in `Notifier.cpp`.
TestCase {
Notification {
id: notification
}
function test_notificationHeightProperty () {
compare(Utils.isInteger(notification.notificationHeight), true)
}
function test_notificationOffsetProperty () {
compare(Utils.isInteger(notification.notificationOffset), true)
}
function test_notificationShowMethod () {
compare(Utils.isFunction(notification.show), true)
}
}

View file

@ -365,6 +365,18 @@ function isArray (array) {
// -------------------------------------------------------------------
function isFunction (func) {
return typeof func === 'function'
}
// -------------------------------------------------------------------
function isInteger (integer) {
return integer === parseInt(integer, 10)
}
// -------------------------------------------------------------------
function isString (string) {
return typeof string === 'string' || string instanceof String
}