Changeset View
Changeset View
Standalone View
Standalone View
autotests/providertest.cpp
Show First 20 Lines • Show All 342 Lines • ▼ Show 20 Line(s) | 339 | { | |||
---|---|---|---|---|---|
343 | QSignalSpy spy(&p, SIGNAL(showEncouragementMessage())); | 343 | QSignalSpy spy(&p, SIGNAL(showEncouragementMessage())); | ||
344 | QVERIFY(spy.isValid()); | 344 | QVERIFY(spy.isValid()); | ||
345 | p.setEncouragementDelay(0); | 345 | p.setEncouragementDelay(0); | ||
346 | p.setApplicationStartsUntilEncouragement(0); | 346 | p.setApplicationStartsUntilEncouragement(0); | ||
347 | p.setEncouragementInterval(1); | 347 | p.setEncouragementInterval(1); | ||
348 | QVERIFY(!spy.wait(100)); | 348 | QVERIFY(!spy.wait(100)); | ||
349 | } | 349 | } | ||
350 | } | 350 | } | ||
351 | | ||||
352 | void testDataSourceLookup() | ||||
353 | { | ||||
354 | Provider p; | ||||
355 | | ||||
356 | auto screenInfoDataSource = new ScreenInfoSource; | ||||
357 | auto screenInfoDataSourceId = screenInfoDataSource->id(); | ||||
358 | | ||||
359 | auto platformInfoDataSource = new PlatformInfoSource; | ||||
360 | auto platformInfoDataSourceId = platformInfoDataSource->id(); | ||||
361 | | ||||
362 | p.addDataSource(screenInfoDataSource); | ||||
363 | p.addDataSource(platformInfoDataSource); | ||||
364 | | ||||
365 | QCOMPARE(screenInfoDataSource, p.dataSource(screenInfoDataSourceId)); | ||||
366 | QCOMPARE(platformInfoDataSource, p.dataSource(platformInfoDataSourceId)); | ||||
367 | | ||||
368 | QVERIFY(!p.dataSource(QStringLiteral("SomeInvalidId"))); | ||||
369 | } | ||||
351 | }; | 370 | }; | ||
352 | 371 | | |||
353 | QTEST_MAIN(ProviderTest) | 372 | QTEST_MAIN(ProviderTest) | ||
354 | 373 | | |||
355 | #include "providertest.moc" | 374 | #include "providertest.moc" |