Fix order of blocking calls on FillEventHistoryTest.
We should always call sReplier.getNextFillRequest() before making a UI
assertion, otherwise the later can fail.
Test: commented out the RetryRule @Rule on AutoFillServiceTestCase and ran
FillEventHistoryTest - without this fix, it would consistenly fail.
Bug: 37566627
Change-Id: Id4cc7ebdf831cf788c0ffebe05235e0fde13a06c
diff --git a/tests/autofillservice/src/android/autofillservice/cts/FillEventHistoryTest.java b/tests/autofillservice/src/android/autofillservice/cts/FillEventHistoryTest.java
index b27ad83..5a66582 100644
--- a/tests/autofillservice/src/android/autofillservice/cts/FillEventHistoryTest.java
+++ b/tests/autofillservice/src/android/autofillservice/cts/FillEventHistoryTest.java
@@ -108,8 +108,8 @@
mActivity.onUsername(View::requestFocus);
// Authenticate
- mUiBot.selectDataset("authentication");
sReplier.getNextFillRequest();
+ mUiBot.selectDataset("authentication");
mActivity.assertAutoFilled();
// Verify fill selection
@@ -145,8 +145,8 @@
mActivity.onUsername(View::requestFocus);
// Authenticate
- mUiBot.selectDataset("authentication");
sReplier.getNextFillRequest();
+ mUiBot.selectDataset("authentication");
mUiBot.assertDatasets("dataset");
// Verify fill selection
@@ -177,8 +177,8 @@
// Trigger autofill on username
mActivity.onUsername(View::requestFocus);
waitUntilConnected();
- mUiBot.selectDataset("dataset1");
sReplier.getNextFillRequest();
+ mUiBot.selectDataset("dataset1");
mActivity.assertAutoFilled();
{
@@ -213,8 +213,8 @@
// Trigger autofill on password
mActivity.onPassword(View::requestFocus);
- mUiBot.selectDataset("dataset3");
sReplier.getNextFillRequest();
+ mUiBot.selectDataset("dataset3");
mActivity.assertAutoFilled();
{
diff --git a/tests/autofillservice/src/android/autofillservice/cts/Timeouts.java b/tests/autofillservice/src/android/autofillservice/cts/Timeouts.java
index ae12356..d59d1a5 100644
--- a/tests/autofillservice/src/android/autofillservice/cts/Timeouts.java
+++ b/tests/autofillservice/src/android/autofillservice/cts/Timeouts.java
@@ -29,7 +29,9 @@
/**
* Timeout until framework unbinds from a service.
*/
- static final Timeout IDLE_UNBIND_TIMEOUT = new Timeout("IDLE_UNBIND_TIMEOUT", 5000, 2F, 10000);
+ // TODO: must be higher than RemoteFillService.TIMEOUT_IDLE_BIND_MILLIS, so we should use a
+ // @hidden @Testing constants instead...
+ static final Timeout IDLE_UNBIND_TIMEOUT = new Timeout("IDLE_UNBIND_TIMEOUT", 10000, 2F, 10000);
/**
* Timeout to get the expected number of fill events.