• Etienne Bergeron's avatar
    Enable DPI awareness in unittest · 140fe1bf
    Etienne Bergeron authored
    The browser process is DPI aware.
    
    To be able to detect correctly the configuration on my win10 computer,
    I needed to add the code of this CL.
    
    To make the tests fails, I needed to change the system config to
    increase it to 125%, then I needed to sign-out and sign-in.
    
    see the output:
    
    ../../chrome/browser/ui/views/layout_provider_unittest.cc(70): error: Expected equality of these values:
      system_dpi_scale
        Which is: 1.25
      1.0
        Which is: 1
    The test requires default display settings. The DPI of the display is not 100%. dpi_scale=1.25
    Stack trace:
    Backtrace:
            base::debug::StackTrace::StackTrace [0x00007FFB86ADC648+40] (C:\src\chromium\src\base\debug\stack_trace.cc:203)
            StackTraceGetter::CurrentStackTrace [0x00007FF66C1DB986+86] (C:\src\chromium\src\third_party\googletest\custom\gtest\internal\custom\stack_trace_getter.cc:24)
            testing::internal::UnitTestImpl::CurrentOsStackTraceExceptTop [0x00007FF66C1F172A+90] (C:\src\chromium\src\third_party\googletest\src\googletest\src\gtest.cc:827)
            testing::internal::AssertHelper::operator= [0x00007FF66C1F11F7+87] (C:\src\chromium\src\third_party\googletest\src\googletest\src\gtest.cc:404)
            LayoutProviderTest::SetUpTestSuite [0x00007FF66B9EA76D+1117] (C:\src\chromium\src\chrome\browser\ui\views\layout_provider_unittest.cc:70)
    R=tapted@chromium.org
    Bug: 963868
    
    Change-Id: Ifcda84cbea88c42e9d3b2c5c81c024a1a9abc371
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1630978
    Commit-Queue: Etienne Bergeron <etienneb@chromium.org>
    Reviewed-by: default avatarTrent Apted <tapted@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#665182}
    140fe1bf
layout_provider_unittest.cc 18.1 KB