[Autofill Assistant] Only run interrupts once per WaitForDom.

Before this patch, the same interrupt would be run in a WaitForDom as
long as its precondition match. This turned out to be difficult to work
with in the common case where the interrupt clicks on a button to
dismiss the element in the precondition: if we check the preconditions
again right away after clicking, the effect of the click would not have
time to apply and the interrupt would be run immediately afterwards.

The current workaround is to define interrupts to only run once, but
what if the interrupt was meant to dismiss a dialog that can appear more
than once?

With this patch, the same interrupt is run only once in a WaitForDom,
but it can still be run multiple times in a script. This way, we avoid
the case described above and can reuse interrupt that dismiss.

Bug: 806868
Change-Id: I10c59b8c8b4d9cd5be1c0874694595e9dc3ff518
Reviewed-on: https://chromium-review.googlesource.com/c/1406971
Commit-Queue: Stephane Zermatten <szermatt@chromium.org>
Reviewed-by: Ganggui Tang <gogerald@chromium.org>
Cr-Commit-Position: refs/heads/master@{#622398}
3 files changed