diff options
author | Lorn Potter <lorn.potter@nokia.com> | 2010-09-07 11:36:19 +1000 |
---|---|---|
committer | Lorn Potter <lorn.potter@nokia.com> | 2010-09-07 11:36:19 +1000 |
commit | 0af86c27ce9b1f5f7119e822ae47918e3384c23d (patch) | |
tree | daa67af6eeda6f522182b2ebe0c9fbaac12fe67f /tests/auto/qsystemdeviceinfo/tst_qsystemdeviceinfo.cpp | |
parent | f61214e6c6506933f4ee533191540f7e352c3598 (diff) |
add wireless keyboard connect, keyboard type and keyboard flip.
Task-number: MOBILITY-439
Diffstat (limited to 'tests/auto/qsystemdeviceinfo/tst_qsystemdeviceinfo.cpp')
-rw-r--r-- | tests/auto/qsystemdeviceinfo/tst_qsystemdeviceinfo.cpp | 38 |
1 files changed, 36 insertions, 2 deletions
diff --git a/tests/auto/qsystemdeviceinfo/tst_qsystemdeviceinfo.cpp b/tests/auto/qsystemdeviceinfo/tst_qsystemdeviceinfo.cpp index b716962738..e5b4c555a8 100644 --- a/tests/auto/qsystemdeviceinfo/tst_qsystemdeviceinfo.cpp +++ b/tests/auto/qsystemdeviceinfo/tst_qsystemdeviceinfo.cpp @@ -52,6 +52,7 @@ Q_DECLARE_METATYPE(QSystemDeviceInfo::InputMethodFlags); Q_DECLARE_METATYPE(QSystemDeviceInfo::Profile); Q_DECLARE_METATYPE(QSystemDeviceInfo::SimStatus); +Q_DECLARE_METATYPE(QSystemDeviceInfo::KeyboardTypeFlags); class tst_QSystemDeviceInfo : public QObject { @@ -81,8 +82,9 @@ private slots: void tst_currentBluetoothPowerState(); - // void tst_powerState_data(); -// void tst_powerState(); + void tst_keyboardType(); + void tst_isWirelessKeyboardConnected(); + void tst_isKeyboardFlipOpen(); }; /* @@ -102,6 +104,9 @@ void tst_QSystemDeviceInfo::initTestCase() qRegisterMetaType<QSystemDeviceInfo::Profile>("QSystemDeviceInfo::Profile"); qRegisterMetaType<QSystemDeviceInfo::SimStatus>("QSystemDeviceInfo::SimStatus"); + + qRegisterMetaType<QSystemDeviceInfo::KeyboardTypeFlags>("QSystemDeviceInfo::KeyboardTypeFlags"); + } void tst_QSystemDeviceInfo::tst_inputMethodType() @@ -236,5 +241,34 @@ void tst_QSystemDeviceInfo::tst_currentBluetoothPowerState() QVERIFY(state || !state); } + +void tst_QSystemDeviceInfo::tst_keyboardType() +{ + QSystemDeviceInfo di; + QSystemDeviceInfo::KeyboardTypeFlags flags = di.keyboardType(); + + QVERIFY( (flags && QSystemDeviceInfo::UnknownKeyboard == QSystemDeviceInfo::UnknownKeyboard) + || (flags && QSystemDeviceInfo::SoftwareKeyboard == QSystemDeviceInfo::SoftwareKeyboard) + || (flags && QSystemDeviceInfo::ITUKeypad == QSystemDeviceInfo::ITUKeypad) + || (flags && QSystemDeviceInfo::HalfQwertyKeyboard == QSystemDeviceInfo::HalfQwertyKeyboard) + || (flags && QSystemDeviceInfo::FullQwertyKeyboard == QSystemDeviceInfo::FullQwertyKeyboard) + || (flags && QSystemDeviceInfo::WirelessKeyboard == QSystemDeviceInfo::WirelessKeyboard)); +} + +void tst_QSystemDeviceInfo::tst_isWirelessKeyboardConnected() +{ + QSystemDeviceInfo di; + bool on = di.isWirelessKeyboardConnected(); + QVERIFY(on || !on); +} + +void tst_QSystemDeviceInfo::tst_isKeyboardFlipOpen() +{ + QSystemDeviceInfo di; + bool on = di.isKeyboardFlipOpen(); + QVERIFY(on || !on); +} + + QTEST_MAIN(tst_QSystemDeviceInfo) #include "tst_qsystemdeviceinfo.moc" |