0

[CrOS MultiDevice] DeviceReenroller: Reorder unit test member variables to fix ASAN build

Because DeviceReenroller now uses the DeviceSyncClient in the destructor
to remove itself as a DeviceSyncClient::Observer, DeviceReenroller needs
to be destroyed before the DeviceSyncClient in the unit tests.

Bug: 887953, 887557, 887758
Change-Id: I23e8f150ef08e6ad3d388f4ed86d47123077f71a
Tested: Unit tests with ASAN on
Reviewed-on: https://chromium-review.googlesource.com/1238818
Commit-Queue: Josh Nohle <nohle@chromium.org>
Reviewed-by: James Hawkins <jhawkins@chromium.org>
Reviewed-by: Jeremy Klein <jlklein@chromium.org>
Cr-Commit-Position: refs/heads/master@{#593220}
This commit is contained in:
Josh Nohle
2018-09-21 16:37:57 +00:00
committed by Commit Bot
parent 75a4683443
commit 135c87489d

@ -81,14 +81,14 @@ class MultiDeviceSetupDeviceReenrollerTest : public testing::Test {
}
private:
std::unique_ptr<DeviceReenroller> device_reenroller_;
cryptauth::RemoteDeviceRef test_local_device_;
std::unique_ptr<device_sync::FakeDeviceSyncClient> fake_device_sync_client_;
std::unique_ptr<cryptauth::FakeGcmDeviceInfoProvider>
fake_gcm_device_info_provider_;
base::MockOneShotTimer* mock_timer_;
cryptauth::RemoteDeviceRef test_local_device_;
std::unique_ptr<DeviceReenroller> device_reenroller_;
DISALLOW_COPY_AND_ASSIGN(MultiDeviceSetupDeviceReenrollerTest);
};