• James Vecore's avatar
    [Nearby] Fix receive status updates getting lost · a8d29f0a
    James Vecore authored
    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: default avatarRyan Hansberry <hansberry@chromium.org>
    Auto-Submit: James Vecore <vecore@google.com>
    Cr-Commit-Position: refs/heads/master@{#808069}
    a8d29f0a
nearby_sharing_service_impl.cc 116 KB