Skip to content

Commit

Permalink
Merge #801(nvrWhere): Rework enableEncryption test to be less timing …
Browse files Browse the repository at this point in the history
…dependent
  • Loading branch information
KitsuneRal authored Sep 16, 2024
2 parents b883c61 + 9652fb9 commit dd8d3ea
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions autotests/testolmaccount.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -445,20 +445,15 @@ void TestOlmAccount::claimMultipleKeys()
void TestOlmAccount::enableEncryption()
{
CREATE_CONNECTION(alice, "alice9"_L1, "secret"_L1, "AlicePhone"_L1)
alice->syncLoop();

QSignalSpy createRoomSpy(alice.get(), &Connection::loadedRoomState);
auto job = alice->createRoom(Connection::PublishRoom, {}, {}, {}, {});
QSignalSpy createRoomSpy(job, &BaseJob::success);
QVERIFY(createRoomSpy.wait(10000));
alice->sync();
connect(alice.get(), &Connection::syncDone, this, [alice](){
alice->sync();
});
while(alice->roomsCount(JoinState::Join) == 0) {
QThread::sleep(100);
}

auto room = alice->rooms(JoinState::Join)[0];
room->activateEncryption();
QSignalSpy encryptionSpy(room, &Room::encryption);
room->activateEncryption();
QVERIFY(encryptionSpy.wait(10000));
QVERIFY(room->usesEncryption());
}
Expand Down

0 comments on commit dd8d3ea

Please sign in to comment.