• James Cook's avatar
    lacros: Provide default LacrosInitParams when running tests · b18b2a9d
    James Cook authored
    browser_tests disable all crosapi calls and do not call
    LacrosChromeService::Init(). LacrosChromeServiceImpl::init_params_ is
    therefore "null". However, because LacrosInitParams is a small mojo
    struct, it is an InlinedStructPtr, and init_params_.get() returns
    a non-null pointer. This means existing code in lacros can call
    LacrosChromeServiceImpl::init_params() and get a non-null value.
    
    A later CL increases the size of LacrosInitParams, so it cannot be
    inlined. This causes browser_tests failures because init_params()
    starts returning null.
    
    We want some value for InitParams in tests. Therefore create a
    default-constructed version in tests.
    
    Bug: none
    Change-Id: I3ee0b15a276d0f04fc024ba3fbd7d2d1a892a72b
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2463568
    Commit-Queue: James Cook <jamescook@chromium.org>
    Commit-Queue: Erik Chen <erikchen@chromium.org>
    Auto-Submit: James Cook <jamescook@chromium.org>
    Reviewed-by: default avatarErik Chen <erikchen@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#815711}
    b18b2a9d
lacros_chrome_service_impl.cc 13.9 KB