In tests, it's possible to have multiple UkmRecorder instances accessible at the same time: both a TestUkmRecorder instance and a UkmService (which implements UkmRecorder) can be accessed, as UkmService is accessible via MetricsServiceClient::GetUkmService().
We should make it impossible to have multiple instances.
Steven suggested:
"One direction I have considered going is to make UkmService compose rather than inherit from UkmRecorder, which might make it possible to have a UkmService with a TestUkmRecorder."
We should consider switching to this composition-based approach, where the UkmService owns a UkmRecorder(either test or real) instance.
Comment 1 by bugdroid1@chromium.org
, Oct 18 2017