mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-19 13:27:35 +02:00
Merge e2b55cd201 into merged_master (Bitcoin PR bitcoin-core/gui#335)
This commit is contained in:
commit
cf23962d62
1 changed files with 5 additions and 4 deletions
|
|
@ -21,9 +21,9 @@
|
|||
#endif
|
||||
|
||||
#include <QAction>
|
||||
#include <QEventLoop>
|
||||
#include <QLineEdit>
|
||||
#include <QScopedPointer>
|
||||
#include <QSignalSpy>
|
||||
#include <QTest>
|
||||
#include <QTextEdit>
|
||||
#include <QtGlobal>
|
||||
|
|
@ -34,13 +34,14 @@ namespace {
|
|||
//! Call getblockchaininfo RPC and check first field of JSON output.
|
||||
void TestRpcCommand(RPCConsole* console)
|
||||
{
|
||||
QEventLoop loop;
|
||||
QTextEdit* messagesWidget = console->findChild<QTextEdit*>("messagesWidget");
|
||||
QObject::connect(messagesWidget, &QTextEdit::textChanged, &loop, &QEventLoop::quit);
|
||||
QLineEdit* lineEdit = console->findChild<QLineEdit*>("lineEdit");
|
||||
QSignalSpy mw_spy(messagesWidget, &QTextEdit::textChanged);
|
||||
QVERIFY(mw_spy.isValid());
|
||||
QTest::keyClicks(lineEdit, "getblockchaininfo");
|
||||
QTest::keyClick(lineEdit, Qt::Key_Return);
|
||||
loop.exec();
|
||||
QVERIFY(mw_spy.wait(1000));
|
||||
QCOMPARE(mw_spy.count(), 2);
|
||||
QString output = messagesWidget->toPlainText();
|
||||
UniValue value;
|
||||
value.read(output.right(output.size() - output.lastIndexOf(QChar::ObjectReplacementCharacter) - 1).toStdString());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue