Do not check if callback is null in test Socket classes.
Do not check if callback is null in test-only AsyncSocket subclasses in RunCallback(). If the method was supposed to handle the case of null callback, it should be called MaybeRunCallback() instead. Add DCHECKs on callback at call sites to document expectations. Also, avoid double move when unnecessary. Also, fix GCMConnectionHandlerImplTests. Calling MockTCPClientSocket::Connect() with null callback on ASYNC mock data is not consistent with the async idiom used in //net. Sure it didn't use to blow up, because MockClientSocket::RunCallback() special-cased null callbacks. :( Also, use make_unique instead of new throughout google_apis/gcm/engine/connection_handler_impl_unittest.cc. Bug: 807724 Change-Id: I3adb8d2a09c87fa004b1b4e7a8cf6f0edff064a6 Reviewed-on: https://chromium-review.googlesource.com/1064193 Commit-Queue: Bence Béky <bnc@chromium.org> Reviewed-by:Eric Roman <eroman@chromium.org> Reviewed-by:
Nicolas Zea <zea@chromium.org> Cr-Commit-Position: refs/heads/master@{#561528}
Showing
Please register or sign in to comment