• Devlin Cronin's avatar
    [Extensions Click-to-Script] (Hopefully) de-flake action runner tests · 5c5abd24
    Devlin Cronin authored
    ExtensionActionRunnerBrowserTest.ActiveScriptsAreDisplayedAndDelayExecution
    has been flaky on Windows. Looking at the test, this could be caused by
    not waiting a sufficient amount of time after loading the extension for
    the extension background page to register a listener for the tab update.
    This, in turn, would result in the extension not appearing to want to
    run when it should.
    
    Solve this potential issue by dispatching a "ready" message from the
    extension once it has registered the listener, and waiting for that
    message in the C++ before creating the new tab. Also explicitly wait
    for the script to be injected in the case of automatic injection, and
    wait for the blocked action to be added for the case of requiring
    consent.
    
    Additionally, break apart the test from being a single test that
    exercised four different expectations to four tests, each managing a
    single expectation. This eliminates the chance of any of the test steps
    interfering with one another.
    
    Bug: 867882
    
    Change-Id: I2859bd35573415080e3c70a3e08bf2108430ee28
    Reviewed-on: https://chromium-review.googlesource.com/1195844
    Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
    Reviewed-by: default avatarKaran Bhatia <karandeepb@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#587822}
    5c5abd24
extension_action_runner.h 8.69 KB