Skip to content
Snippets Groups Projects
Commit fb9a519e authored by Hui Peng's avatar Hui Peng
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
parent 15fbebc8
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment