diff options
author | Tobias Thierer <tobiast@google.com> | 2019-04-04 18:55:15 +0100 |
---|---|---|
committer | Tobias Thierer <tobiast@google.com> | 2019-04-06 14:25:32 +0000 |
commit | c431c3632a480191785efc981ce53cf843a34ec7 (patch) | |
tree | b9904bebd2bae9e035f1897e54786e81fcbee523 /annotations/generate_annotated_java_files.py | |
parent | 259770cd147e512f98dcec269504df0ff774f163 (diff) |
Fix Os.getDefault() BlockGuard test.
A test was asserting that libcore.io.getDefault() was instanceof BlockguardOs.
This test failed if it was run after a different Os had been installed via
Os.compareAndSetDefault(), which currently doesn't happen in AOSP but happens
on internal / downstream branches.
A recent change [1] to OsTest did not touch the test method in question
but seems to have affected some ordering such that the test started
failing.
This CL fixes this by replacing the test with one that asserts that
Os.getDefault().rename(String,String) results in particular BlockGuard
invocations; the test now cares about the particular BlockGuard
invocations but does no longer care whether Os.getDefault() is directly
instanceof BlockguardOs or whether the notification happens some other
way, eg. via delegation to BlockguardOs or by directly calling
BlockGuard.
This CL also moves the test from OsTest.java to BlockGuardOsTest.java,
since that class already had most of the required test setup
boilerplate and because BlockGuard is part of what it tests.
[1] http://r.android.com/937425 commit 62db047bc129fe96cca0f4a347e9b1fb30163acb
Fixes: 129926881
Bug: 129523169
Test: atest CtsLibcoreTestCases:libcore.libcore.io.{,BlockGuard}OsTest
(cherry picked from commit d63ef2e45ff421d507356503f1fe80628ba806f3)
Change-Id: Ie45168a8fd633d47a2118030eb454e406ce0f6b4
Merged-In: I1cc3799b6d0905c01b998ecc561217f90e02dcbe
Diffstat (limited to 'annotations/generate_annotated_java_files.py')
0 files changed, 0 insertions, 0 deletions