• Karan Bhatia's avatar
    Reland: DNR tests: Use ExtensionTestMessageListener to detect background page load. · c4eb630b
    Karan Bhatia authored
    This CL relands r555005 which was reverted since it introduced flakiness. The
    flakiness was most probably since we ended up creating the
    ExtensionTestMessageListener too late for the
    DeclarativeNetRequestBrowserTest_Packed.PageWhitelistingAPI test. The listener
    was created in SetUpOnMainThread override while the InstalledLoader ends up
    loading all extensions before this (during
    BrowserMainLoop::CreateStartupTasks()). Hence a subsequent
    ExtensionTestMessageListener::WaitUntilSatisfied() call would end up running
    indefinitely. To get around this, only wait for the background page to load if
    the background page isn't already ready.
    
    BUG= 696822, 838536
    
    Change-Id: I2b288c6e6703e5be588d480403b362bf7c30db4e
    Reviewed-on: https://chromium-review.googlesource.com/1043271
    Commit-Queue: Karan Bhatia <karandeepb@chromium.org>
    Reviewed-by: default avatarIstiaque Ahmed <lazyboy@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#556319}
    c4eb630b
test_utils.h 3.84 KB