[SmartLock] Move life cycle observation responsibility to UnlockManager.
Make UnlockManagerImplTest more closely follow how UnlockManagerImpl actually behaves in production by making UnlockManagerImpl directly listen on RemoteDeviceLifeCycle::Observer events, and make FakeRemoteDeviceLifeCycle::Start() notify observers. This all allows the test RemoteDeviceLifeCycle object to notify UnlockManager as soon as its state changes, instead of having to manually emulate state change events. This CL unblocks testing for the bug fix (crbug.com/890047) in the subsequent CL. As it turns out, this refactor actually exposes that bug -- had this test code been structured this way before, the bug could have been fixed long ago. TODOs have been left in the test code marking accommodations made for the bug -- they will be removed in the subsequent CL. Bug: 926608, 890047 Change-Id: Iee96974d9376bda1f75deba314f28efccae7052c Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1716154 Commit-Queue: Ryan Hansberry <hansberry@chromium.org> Reviewed-by:Kyle Horimoto <khorimoto@chromium.org> Cr-Commit-Position: refs/heads/master@{#680309}
Showing
Please register or sign in to comment