• Maksim Sisov's avatar
    X11 and Ozone: early initialize FeatureList · 48aa2f8e
    Maksim Sisov authored
    We need to initialize the FeatureList as early as possible.
    Otherwise, VizTestSuite, AuraTestSuite, and others may not be
    properly initialized because they need to check whether OzonePlatform
    is used (that is not a problem when either use_x11 or use_ozone is set.
    But when both are set, the tests fail to initialize for Ozone case and
    take non-Ozone X11 path).
    
    IsUsingOzonePlatform has static const initializer now so that tests
    won't override the return value of this method. However, we need
    to call that at least one as early as possible. Thus, TestSuite::Run
    is the best place for that.
    
    What is more, we also need to append UseOzonePlatform feature to
    the CommandLine so that other processes get the same value as the
    original process. The reason why we need to do that is that CommandLine
    takes enabled/disabled features during the tests overriding the initial
    FeatureList. Once it is restored, the CommandLine has already been
    updated and won't be updated again. Thus, we need to append the
    flag and let other processes start correctly (like GPU process).
    
    -----
    
    PS: Please note that this is a temp solution that will help to choose
    between ozone and non-ozone X11 build. The switch that will be used
    to choose the path is --enable-features=UseOzonePlatform. Once
    non-Ozone X11 path is removed (hopefully by Q1 2021 depending on how
    the finch trial goes), the wrapper will be removed.
    
    Please also note that it's impossible to build use_x11 && use_ozone
    without some hacks in PlatformCursor code. The changes to that are
    on their way to upstream.
    
    ----
    
    Bug: 1085700
    Change-Id: I122bec7441b3dbd199eb4287338f8903878d2b3a
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2333844Reviewed-by: default avatarDaniel Cheng <dcheng@chromium.org>
    Reviewed-by: default avatarScott Violet <sky@chromium.org>
    Reviewed-by: default avatarJonathan Ross <jonross@chromium.org>
    Commit-Queue: Maksim Sisov (GMT+3) <msisov@igalia.com>
    Cr-Commit-Position: refs/heads/master@{#798991}
    48aa2f8e
browser_test_base.cc 34.7 KB