Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit d24a07f5 authored by Hui Peng's avatar Hui Peng Committed by Android Build Coastguard Worker
Browse files

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
(cherry picked from commit fb9a519e)
Merged-In: I7dd3a0e665f72c27e4d1844f45ec15a8dd1ddb53
parent 6a2e3c85
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment