• Mohsen Izadi's avatar
    Fix flakiness in HeadlessBrowserTest · 7221e1a3
    Mohsen Izadi authored
    In HeadlessContentMainDelegate::RunProcess(), if the headless browser
    instance is destroyed before browser runner is shut down, GPU clients
    might end up accessing the destroyed object in the meantime. An example
    is when a client tries to establish a GPU channel ending up accessing
    destroyed HeadlessBrowserImpl::options in order to instantiate
    viz::GpuHostImpl. This CL changes the ordering to fix the race
    condition.
    
    BUG=881211
    TEST=headless_browsertests --gtest_filter=HeadlessBrowserTest.*
    
    Change-Id: I2518eeefcc1e446a59d680fa78eab88e26765404
    Reviewed-on: https://chromium-review.googlesource.com/1251331Reviewed-by: default avatarSami Kyöstilä <skyostil@chromium.org>
    Commit-Queue: Mohsen Izadi <mohsen@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#595465}
    7221e1a3
headless_content_main_delegate.cc 14 KB