fix(non linear font scaling): fix test timeout flakiness

Fix: 283186902
Test: atest FrameworksCoreTests:android.content.res.FontScaleConverterActivityTest
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:2d5f2f97b65729c6af1d08b5541bad375719e5b6)
Merged-In: I67dc51b587602f72949549ac17253628ad1a2e1a
Change-Id: I67dc51b587602f72949549ac17253628ad1a2e1a
This commit is contained in:
Tyler Freeman
2023-05-19 11:36:07 -07:00
committed by Cherrypicker Worker
parent 149c2ccf01
commit 08dc87a0f0

View File

@@ -137,7 +137,7 @@ public class FontScaleConverterActivityTest {
);
});
PollingCheck.waitFor(/* timeout= */ 5000, () -> {
PollingCheck.waitFor(/* timeout= */ 7000, () -> {
AtomicBoolean isActivityAtCorrectScale = new AtomicBoolean(false);
rule.getScenario().onActivity(activity ->
isActivityAtCorrectScale.set(
@@ -146,12 +146,7 @@ public class FontScaleConverterActivityTest {
.fontScale == fontScale
)
);
return isActivityAtCorrectScale.get() && InstrumentationRegistry
.getInstrumentation()
.getContext()
.getResources()
.getConfiguration()
.fontScale == fontScale;
return isActivityAtCorrectScale.get();
});
}