[Nearby] Fix receive status updates getting lost
Due to an order of operations issue in OnPayloadTransferUpdate() when receiving files Disconnect() was being called before the transfer updates were communicated. This caused the share target to get cleaned up before sending the completed status which left the transfer hanging around in the UI. This was missed in unit-tests due to the fact that the |FakeNearbyConnections| triggers the disconnect handler on Close() instead of the destructor like the real one. By changing the way Disconnect() behaves to call Close() on the connection we can get the tests to fail due to the missing status. Then the fix gets the tests passing again. Verified on device with a real transfer. Fixed: 1126620 Change-Id: Ida0ab7dda01a81ce7fb470333059029e461972ae Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2413397 Commit-Queue: Ryan Hansberry <hansberry@chromium.org> Reviewed-by:Ryan Hansberry <hansberry@chromium.org> Auto-Submit: James Vecore <vecore@google.com> Cr-Commit-Position: refs/heads/master@{#808069}
Showing
Please register or sign in to comment