@@ -14,7 +14,7 @@
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17−#include "HomeKeyWatcher.h"
17+#include "WindowInputMonitor.h"
19#include <QTest>
19#include <QTest>
20#include <QSignalSpy>
20#include <QSignalSpy>
@@ -71,7 +71,7 @@ public:
72using namespace UnityUtil;
72using namespace UnityUtil;
74−class HomeKeyWatcherTest : public QObject {
74+class WindowInputMonitorTest : public QObject {
76private Q_SLOTS:
76private Q_SLOTS:
77 void init(); // called right before each and every test function is executed
77 void init(); // called right before each and every test function is executed
@@ -88,25 +88,25 @@ private:
88 FakeTimerFactory *m_fakeTimerFactory;
88 FakeTimerFactory *m_fakeTimerFactory;
91−void HomeKeyWatcherTest::init()
91+void WindowInputMonitorTest::init()
93 m_fakeTimerFactory = new FakeTimerFactory;
93 m_fakeTimerFactory = new FakeTimerFactory;
96−void HomeKeyWatcherTest::cleanup()
96+void WindowInputMonitorTest::cleanup()
98 delete m_fakeTimerFactory;
98 delete m_fakeTimerFactory;
99 m_fakeTimerFactory = nullptr;
99 m_fakeTimerFactory = nullptr;
103−void HomeKeyWatcherTest::passTime(qint64 timeSpanMs)
103+void WindowInputMonitorTest::passTime(qint64 timeSpanMs)
105 qint64 finalTime = FakeElapsedTimer::msecsSinceEpoch + timeSpanMs;
105 qint64 finalTime = FakeElapsedTimer::msecsSinceEpoch + timeSpanMs;
106 m_fakeTimerFactory->updateTime(finalTime);
106 m_fakeTimerFactory->updateTime(finalTime);
109−void HomeKeyWatcherTest::touchTapTouch_data()
109+void WindowInputMonitorTest::touchTapTouch_data()
111 QTest::addColumn<int>("silenceBeforeTap");
111 QTest::addColumn<int>("silenceBeforeTap");
112 QTest::addColumn<int>("tapDuration");
112 QTest::addColumn<int>("tapDuration");
@@ -121,14 +121,14 @@ void HomeKeyWatcherTest::touchTapTouch_data()
121 QTest::newRow("isolated long press") << 1000 << 200 << 1000 << 0;
121 QTest::newRow("isolated long press") << 1000 << 200 << 1000 << 0;
124−void HomeKeyWatcherTest::touchTapTouch()
124+void WindowInputMonitorTest::touchTapTouch()
126 QFETCH(int, silenceBeforeTap);
126 QFETCH(int, silenceBeforeTap);
127 QFETCH(int, tapDuration);
127 QFETCH(int, tapDuration);
128 QFETCH(int, silenceAfterTap);
128 QFETCH(int, silenceAfterTap);
129 QFETCH(int, expectedActivatedCount);
129 QFETCH(int, expectedActivatedCount);
130− HomeKeyWatcher homeKeyWatcher(m_fakeTimerFactory->create(), new FakeElapsedTimer);
130+ WindowInputMonitor homeKeyWatcher(m_fakeTimerFactory->create(), new FakeElapsedTimer);
131− QSignalSpy activatedSpy(&homeKeyWatcher, &HomeKeyWatcher::activated);
131+ QSignalSpy activatedSpy(&homeKeyWatcher, &WindowInputMonitor::activated);
132 QVERIFY(activatedSpy.isValid());
132 QVERIFY(activatedSpy.isValid());
@@ -186,10 +186,10 @@ void HomeKeyWatcherTest::touchTapTouch()
186 QCOMPARE(activatedSpy.count(), expectedActivatedCount);
186 QCOMPARE(activatedSpy.count(), expectedActivatedCount);
189−void HomeKeyWatcherTest::tapWhileTouching()
189+void WindowInputMonitorTest::tapWhileTouching()
191− HomeKeyWatcher homeKeyWatcher(m_fakeTimerFactory->create(), new FakeElapsedTimer);
191+ WindowInputMonitor homeKeyWatcher(m_fakeTimerFactory->create(), new FakeElapsedTimer);
192− QSignalSpy activatedSpy(&homeKeyWatcher, &HomeKeyWatcher::activated);
192+ QSignalSpy activatedSpy(&homeKeyWatcher, &WindowInputMonitor::activated);
193 QVERIFY(activatedSpy.isValid());
193 QVERIFY(activatedSpy.isValid());
@@ -318,6 +318,6 @@ AbstractTimer *FakeTimerFactory::create(QObject *parent)
318 return fakeTimer;
318 return fakeTimer;
321−QTEST_GUILESS_MAIN(HomeKeyWatcherTest)
321+QTEST_GUILESS_MAIN(WindowInputMonitorTest)
323−#include "HomeKeyWatcherTest.moc"
323+#include "WindowInputMonitorTest.moc"