URLSession: Update all task types with the byte count of sent data #2760
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
urlSession(_:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend:)
was only sent to tasks of type URLSesisonUploadTask, but testing showed
it should be sent to all task types.
Update tests that now see an extra delegate callback of this method.
test_simpleUploadWithDelegateProvidingInputStream was flaky due to the
expectation sometimes being fulfilled multiple times as it was
fulfilled in the urlSession(_:dataTask:didReceive:) delegate.
Migrate this test to the SessionDelegate and add extra tests to check
the response and delegate callbacks for each HTTP method.
For HTTPUploadDelegate, add the expectation fulfilment to a delegate
callback for urlSession(_ :task:didCompleteWithError:) so that
test_simpleUploadWithDelegate() still works.