2
* Copyright (C) 2017 Canonical, Ltd.
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU Lesser General Public License as published by
6
* the Free Software Foundation; version 3.
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU Lesser General Public License for more details.
13
* You should have received a copy of the GNU Lesser General Public License
14
* along with this program. If not, see <http://www.gnu.org/licenses/>.
17
#include "printer/printersignalhandler.h"
24
class TestSignalHandler : public QObject
30
PrinterSignalHandler handler(500);
31
QSignalSpy modifiedSpy(&handler, SIGNAL(printerModified(const QString&)));
33
for (int i = 0; i < 500; i++) {
34
handler.onPrinterStateChanged("spam!", "ipp://bar/baz", "printer-a", 0, "none", true);
37
modifiedSpy.wait(1000);
38
QCOMPARE(modifiedSpy.count(), 1);
42
QTEST_GUILESS_MAIN(TestSignalHandler)
43
#include "tst_signalhandler.moc"