Changeset View
Changeset View
Standalone View
Standalone View
autotests/kded/tablethandler/testtablethandler.cpp
Show First 20 Lines • Show All 85 Lines • ▼ Show 20 Line(s) | 84 | { | |||
---|---|---|---|---|---|
86 | m_notifyTitle = title; | 86 | m_notifyTitle = title; | ||
87 | m_notifyMessage = message; | 87 | m_notifyMessage = message; | ||
88 | } | 88 | } | ||
89 | 89 | | |||
90 | 90 | | |||
91 | 91 | | |||
92 | void TestTabletHandler::onProfileChanged(const QString& tabletID, const QString& profile) | 92 | void TestTabletHandler::onProfileChanged(const QString& tabletID, const QString& profile) | ||
93 | { | 93 | { | ||
94 | Q_UNUSED(tabletID) | ||||
95 | | ||||
94 | m_profileChanged = profile; | 96 | m_profileChanged = profile; | ||
95 | } | 97 | } | ||
96 | 98 | | |||
97 | 99 | | |||
98 | 100 | | |||
99 | void TestTabletHandler::onTabletAdded(const TabletInformation& info) | 101 | void TestTabletHandler::onTabletAdded(const TabletInformation& info) | ||
100 | { | 102 | { | ||
101 | m_tabletRemoved = false; | 103 | m_tabletRemoved = false; | ||
102 | m_tabletAdded = true; | 104 | m_tabletAdded = true; | ||
103 | m_tabletAddedInformation = info; | 105 | m_tabletAddedInformation = info; | ||
104 | } | 106 | } | ||
105 | 107 | | |||
106 | 108 | | |||
107 | 109 | | |||
108 | void TestTabletHandler::onTabletRemoved(const QString &tabletID) | 110 | void TestTabletHandler::onTabletRemoved(const QString &tabletID) | ||
109 | { | 111 | { | ||
112 | Q_UNUSED(tabletID) | ||||
113 | | ||||
110 | m_tabletAdded = false; | 114 | m_tabletAdded = false; | ||
111 | m_tabletRemoved = true; | 115 | m_tabletRemoved = true; | ||
112 | } | 116 | } | ||
113 | 117 | | |||
114 | 118 | | |||
115 | 119 | | |||
116 | void TestTabletHandler::initTestCase() | 120 | void TestTabletHandler::initTestCase() | ||
117 | { | 121 | { | ||
▲ Show 20 Lines • Show All 66 Lines • ▼ Show 20 Line(s) | 181 | { | |||
184 | QCOMPARE(m_profileChanged, QLatin1String("test")); | 188 | QCOMPARE(m_profileChanged, QLatin1String("test")); | ||
185 | 189 | | |||
186 | // compare start parameters | 190 | // compare start parameters | ||
187 | QCOMPARE(m_tabletHandler->getProperty(QLatin1String("4321"), DeviceType::Eraser, Property::Rotate), ScreenRotation::NONE.key()); | 191 | QCOMPARE(m_tabletHandler->getProperty(QLatin1String("4321"), DeviceType::Eraser, Property::Rotate), ScreenRotation::NONE.key()); | ||
188 | QCOMPARE(m_tabletHandler->getProperty(QLatin1String("4321"), DeviceType::Stylus, Property::Rotate), ScreenRotation::NONE.key()); | 192 | QCOMPARE(m_tabletHandler->getProperty(QLatin1String("4321"), DeviceType::Stylus, Property::Rotate), ScreenRotation::NONE.key()); | ||
189 | QCOMPARE(m_tabletHandler->getProperty(QLatin1String("4321"), DeviceType::Touch, Property::Rotate), ScreenRotation::NONE.key()); | 193 | QCOMPARE(m_tabletHandler->getProperty(QLatin1String("4321"), DeviceType::Touch, Property::Rotate), ScreenRotation::NONE.key()); | ||
190 | 194 | | |||
191 | // rotate screen | 195 | // rotate screen | ||
192 | m_tabletHandler->onScreenRotated(ScreenRotation::HALF); | 196 | m_tabletHandler->onScreenRotated(Qt::InvertedLandscapeOrientation); | ||
193 | 197 | | |||
194 | // validate result | 198 | // validate result | ||
195 | QCOMPARE(m_tabletHandler->getProperty(QLatin1String("4321"), DeviceType::Eraser, Property::Rotate), ScreenRotation::HALF.key()); | 199 | QCOMPARE(m_tabletHandler->getProperty(QLatin1String("4321"), DeviceType::Eraser, Property::Rotate), ScreenRotation::HALF.key()); | ||
196 | QCOMPARE(m_tabletHandler->getProperty(QLatin1String("4321"), DeviceType::Stylus, Property::Rotate), ScreenRotation::HALF.key()); | 200 | QCOMPARE(m_tabletHandler->getProperty(QLatin1String("4321"), DeviceType::Stylus, Property::Rotate), ScreenRotation::HALF.key()); | ||
197 | QCOMPARE(m_tabletHandler->getProperty(QLatin1String("4321"), DeviceType::Touch, Property::Rotate) , ScreenRotation::HALF.key()); | 201 | QCOMPARE(m_tabletHandler->getProperty(QLatin1String("4321"), DeviceType::Touch, Property::Rotate) , ScreenRotation::HALF.key()); | ||
198 | 202 | | |||
199 | QWARN("testOnScreenRotated(): PASSED!"); | 203 | QWARN("testOnScreenRotated(): PASSED!"); | ||
200 | } | 204 | } | ||
▲ Show 20 Lines • Show All 235 Lines • Show Last 20 Lines |