Changeset View
Changeset View
Standalone View
Standalone View
autotests/qml/qmlhistoryapitest.cpp
Show All 37 Lines | 37 | { | |||
---|---|---|---|---|---|
38 | qRegisterMetaType<HistoryEntry>(); | 38 | qRegisterMetaType<HistoryEntry>(); | ||
39 | QSignalSpy historySpy(mApp->history(), &History::historyEntryAdded); | 39 | QSignalSpy historySpy(mApp->history(), &History::historyEntryAdded); | ||
40 | m_testHelper.evaluate("Falkon.History.addUrl({" | 40 | m_testHelper.evaluate("Falkon.History.addUrl({" | ||
41 | " url: 'https://example.com'," | 41 | " url: 'https://example.com'," | ||
42 | " title: 'Example Domain'" | 42 | " title: 'Example Domain'" | ||
43 | "})"); | 43 | "})"); | ||
44 | QTRY_COMPARE(historySpy.count(), 1); | 44 | QTRY_COMPARE(historySpy.count(), 1); | ||
45 | HistoryEntry entry = qvariant_cast<HistoryEntry>(historySpy.at(0).at(0)); | 45 | HistoryEntry entry = qvariant_cast<HistoryEntry>(historySpy.at(0).at(0)); | ||
46 | QCOMPARE(entry.title, "Example Domain"); | 46 | QCOMPARE(entry.title, QSL("Example Domain")); | ||
47 | 47 | | |||
48 | auto object = m_testHelper.evaluateQObject("Falkon.History"); | 48 | auto object = m_testHelper.evaluateQObject("Falkon.History"); | ||
49 | QSignalSpy qmlHistorySpy(object, SIGNAL(visited(QmlHistoryItem*))); | 49 | QSignalSpy qmlHistorySpy(object, SIGNAL(visited(QmlHistoryItem*))); | ||
50 | mApp->history()->addHistoryEntry(QUrl("https://sample.com"), "Sample Domain"); | 50 | mApp->history()->addHistoryEntry(QUrl("https://sample.com"), "Sample Domain"); | ||
51 | QTRY_COMPARE(qmlHistorySpy.count(), 1); | 51 | QTRY_COMPARE(qmlHistorySpy.count(), 1); | ||
52 | mApp->history()->clearHistory(); | 52 | mApp->history()->clearHistory(); | ||
53 | } | 53 | } | ||
54 | 54 | | |||
Show All 35 Lines |