summaryrefslogtreecommitdiff
path: root/libs/androidfw/StringPool.cpp
diff options
context:
space:
mode:
author Evan Severson <evanseverson@google.com> 2022-09-26 15:26:08 -0700
committer Evan Severson <evanseverson@google.com> 2022-09-27 10:45:23 -0700
commit482f199c66ab16a4d254f4bbaecefb6dec09efb3 (patch)
tree8d6eb1fe907596127327b12d332c8a610754212c /libs/androidfw/StringPool.cpp
parentddcc7f5c68d85a83fb4123cce6207608ce65c6a6 (diff)
Make AppOpsUidStateTracker callbacks more testable
The unit tests will become easier to write when validating callbacks and when having delayed behaviors. This is done by 1: using an executor instead of a handler so that we only need to check if the execute mock is invoked and 2: a custom executor interface that supports delayed execution. Executors are preferred so that this interface will be more consistent with public api guidelines and also because post/send methods in Handler are final so it's impossible to decouple a subclass/mocked Handler's behavior from the current Looper. Finally the test clock implementation takes the custom executor in the constructor so it can tell the executor when time changes so it can execute delayed runnables. Test: AppOpsUidStateTrackerTest Bug: 247111208 Change-Id: I930e7e56630408440f6ca03b4c2ab84b19b20eb9
Diffstat (limited to 'libs/androidfw/StringPool.cpp')
0 files changed, 0 insertions, 0 deletions