Add mocking support for now function in AttributionProcessor
In the regression test in changeid: I1709af943b6fa238dd4df41a62e6add36984c9ec The triggering of the code we want to test depends on the return value of std::chrono::system_clock::now(). To facilicate testing, in this patch we add a now_func_ (a std::function) field in AttributionProcessor and make it call it instead of std::chrono::system_clock::now(). Mocking `now` is made possible by passing a custom function to the constructor of AttributionProcessor. Bug: 254774758 Test: refactoring, existing tests still pass Ignore-AOSP-First: security Change-Id: I7dd3a0e665f72c27e4d1844f45ec15a8dd1ddb53
Loading
Please register or sign in to comment