Skip to content

Commit 19629b9

Browse files
committed
docs(android): the fill sampler's comment states the sampling rule, not the history behind it
1 parent f3b86f1 commit 19629b9

2 files changed

Lines changed: 8 additions & 12 deletions

File tree

‎packages/platform-android/src/__tests__/fill-verification.test.ts‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
// Fill reads the live hierarchy at least three times per attempt (one pre-action target read plus
2-
// the settling samples, 150 ms apart, until the text has held for two of them or the deadline has
3-
// passed). `am instrument` force-stops whatever is already instrumenting the helper package, so a
1+
// Fill reads the live hierarchy at least three times per attempt: one pre-action target read plus
2+
// the settling samples, every 150 ms until the text has held for two of them or the deadline has
3+
// passed. `am instrument` force-stops whatever is already instrumenting the helper package, so a
44
// command-scoped capture stops the automation-helper session after every one of those reads and the
55
// next read pays a fresh `am instrument` start. These tests pin who owns the helper session across
66
// the samples and how long the samples keep coming — not what one sample concludes, which
@@ -94,8 +94,7 @@ test('verification samples re-read the hierarchy instead of sharing one capture'
9494
});
9595

9696
test('a value the app renders late still verifies, as long as it lands before the deadline', async () => {
97-
// Six samples of the hint before the value shows: 900 ms in, past the retired schedule's last
98-
// sample at 500 ms and inside the deadline.
97+
// Six samples of the hint before the value shows, 900 ms in and inside the deadline.
9998
const session = createFillHelperSession({
10099
textForCapture: (captureIndex) => (captureIndex <= 6 ? 'Key echo' : 'chips'),
101100
});

‎packages/platform-android/src/fill-verification.ts‎

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,10 @@ type AndroidFillVerificationContext = {
4444
};
4545

4646
/**
47-
* How the samples that verify a fill are spaced, and how long they keep coming. The typed text
48-
* reaches the accessibility tree when the app renders it, which a React Native controlled input on a
49-
* loaded emulator does later than the three fixed samples (at 0, 150 and 500 ms elapsed: sleeps of
50-
* 0, 150 and 350 ms before each) allowed; an otherwise passing fill failed twice on a 4-vCPU CI
51-
* emulator while the field still showed its hint. So the window is a deadline: sampling continues
52-
* until the text has held for two consecutive samples, which on a fast device is sooner than the
53-
* old schedule's last sample, and the sample taken at the deadline is the answer.
47+
* The sampling rule that verifies a fill: a hierarchy sample every 150 ms until the typed text has
48+
* held for two consecutive samples or the deadline has passed, and the sample taken at the deadline
49+
* is the answer. The typed text reaches the accessibility tree when the app renders it, and a
50+
* React Native controlled input on a loaded emulator renders it late.
5451
*/
5552
const FILL_VERIFICATION_SAMPLE_INTERVAL_MS = 150;
5653
const FILL_VERIFICATION_DEADLINE_MS = 1500;

0 commit comments

Comments
 (0)