Simulate network communication
Up to now, MockReply
s are always finished before they are returned by the Manager
.
However, there might be cases where one wants to delay the signals of the MockReply
or where the MockReply
should behave more like a real QNetworkReply
in that it emits multiple uploadProgress()
or downloadProgress()
signals. This might be useful for example when dealing with race conditions.
Feature Request:
- Provide methods to delay the header and the body of the
MockReply
. For example, something likeMockReplyBuilder::withHeaderDelayedBy()
andMockReplyBuilder::withBodyDelayedBy()
. - Provide methods to simulate network communication. That is, the
MockReply
emits multipleuploadProgress()
ordownloadProgress()
signals (also multiplereadyRead()
?). For example, something likeMockReplyBuilder::withSimulatedDownloadProgress()
andMockReplyBuilder::withSimulatedUploadProgress()
. - The process would then be:
|---------------|-------------|--------------|----------------|
simulated header header body simulated finished
upload delay received delay download
-
abort()
aborts the delay/simulation.