• Bo Liu's avatar
    Reland: Ensure page visibility is consistent after load · 2101161e
    Bo Liu authored
    Broken case is WebContents::WasHidden is called before the first load
    then page visibility remains visible because nothing handles
    PageMsg_WasHidden, and nothing rechecks the state after first load.
    Note RenderView is invisible due to
    EnsureRenderFrameHostVisibilityConsistent.
    
    A related bug is that in this case RenderView is created to be visible
    and then marked visible after. Turns out fixing this will also
    correctly set page visibility, so this CL fixes this bug instead.
    
    Previously reverted due to test flake due to test environment changing
    visibility of WebContents under test. New version uses a WebContents
    that's detached from the window, so should not be subject to such
    external signals.
    
    Bug: 929860
    Change-Id: Id163bc57c79dbaf628eac50014d571aa76ad4ef6
    Reviewed-on: https://chromium-review.googlesource.com/c/1476812Reviewed-by: default avatardanakj <danakj@chromium.org>
    Reviewed-by: default avatarAlex Moshchuk <alexmos@chromium.org>
    Commit-Queue: Bo <boliu@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#633739}
    2101161e
web_contents_impl_browsertest.cc 125 KB