• Scott Violet's avatar
    Revert "Compute colors for the frame and tabs from provided images." · a37ba3b9
    Scott Violet authored
    This reverts commit df84748a.
    
    Reason for revert: To fix unit_tests (I have to revert this before the earlier patch). Likely suspect for BrowserThemePackTest.HiDpiThemeTest failing on bots. For example, https://ci.chromium.org/p/chromium/builders/luci.chromium.ci/linux-chromeos-rel/11230 :
    
    [ RUN      ] BrowserThemePackTest.HiDpiThemeTest
    ../../chrome/browser/themes/browser_theme_pack_unittest.cc:204: Failure
    Expected equality of these values:
      ""
      error
        Which is: "File doesn't exist."
    Stack trace:
    #0 0x0000026103ac testing::internal::UnitTestImpl::CurrentOsStackTraceExceptTop()
    #1 0x00000260fd89 testing::internal::AssertHelper::operator=()
    #2 0x000000fc9b98 BrowserThemePackTest::BuildFromUnpackedExtension()
    #3 0x000000fd22cc BrowserThemePackTest_HiDpiThemeTest_Test::TestBody()
    ../../chrome/browser/themes/browser_theme_pack_unittest.cc:205: Failure
    Value of: valid_value.get()
      Actual: false
    Expected: true
    Stack trace:
    #0 0x0000026103ac testing::internal::UnitTestImpl::CurrentOsStackTraceExceptTop()
    #1 0x00000260fd89 testing::internal::AssertHelper::operator=()
    #2 0x000000fc9e0b BrowserThemePackTest::BuildFromUnpackedExtension()
    #3 0x000000fd22cc BrowserThemePackTest_HiDpiThemeTest_Test::TestBody()
    Received signal 11 SEGV_MAPERR 000000000028
    #0 0x000004d00e1c base::debug::StackTrace::StackTrace()
    #1 0x000004d00981 base::debug::(anonymous namespace)::StackDumpSignalHandler()
    #2 0x7f26bba79330 <unknown>
    #3 0x0000050f3e24 BrowserThemePack::WriteToDisk()
    #4 0x000000fd22db BrowserThemePackTest_HiDpiThemeTest_Test::TestBody()
    #5 0x0000026161b2 testing::Test::Run()
    #6 0x000002616d30 testing::TestInfo::Run()
    #7 0x000002617247 testing::TestCase::Run()
    #8 0x000002622747 testing::internal::UnitTestImpl::RunAllTests()
    #9 0x0000026222bd testing::UnitTest::Run()
    #10 0x0000045565d1 base::TestSuite::Run()
    #11 0x000004557fca base::(anonymous namespace)::LaunchUnitTestsInternal()
    #12 0x000004557e7a base::LaunchUnitTests()
    #13 0x00000454e155 main
    #14 0x7f26b86c9f45 __libc_start_main
    #15 0x0000006fa82a _start
      r8: 0000000000000000  r9: 54656d6568546970 r10: 747365545f747365 r11: 0000000000000000
     r12: 000024a8af0c0d20 r13: 00007fff447924e8 r14: 00007fff44792560 r15: 0000000000000000
      di: 0000000000000000  si: 00007fff44792560  bp: 00007fff44792520  bx: 00007fff44792578
      dx: 00000000000005e7  ax: 0000000000001fdd  cx: 0000000000000023  sp: 00007fff44792490
      ip: 00000000050f3e24 efl: 0000000000010206 cgf: 0000000000000033 erf: 0000000000000004
     trp: 000000000000000e msk: 0000000000000000 cr2: 0000000000000028
    [end of stack trace]
    
    Original change's description:
    > Compute colors for the frame and tabs from provided images.
    > 
    > If theme authors explicitly provide values here, we'll use them; but if they
    > don't, but do provide images, set the colors to be the dominant colors of the
    > images, using an existing K-means algorithm (similar to what we use for
    > computing representative favicon colors etc.).
    > 
    > This allows us to rely on those colors later when deciding what color to make
    > tab text, the new tab button, and similar tabstrip/window frame items.
    > 
    > This also does a bit of cleanup to the theme pack code, e.g. moving a map used
    > in only one function into that function to make its provenance clearer.  I can
    > try to split this apart into more CLs if desired.
    > 
    > Bug: 862664
    > Change-Id: I8c3f15893ad491a6fee8aa5f76ae162cecb2c6fd
    > Reviewed-on: https://chromium-review.googlesource.com/1152517
    > Commit-Queue: Peter Kasting <pkasting@chromium.org>
    > Reviewed-by: Alexei Svitkine <asvitkine@chromium.org>
    > Reviewed-by: Evan Stade <estade@chromium.org>
    > Cr-Commit-Position: refs/heads/master@{#578823}
    
    TBR=pkasting@chromium.org,asvitkine@chromium.org,estade@chromium.org
    
    Change-Id: I6a5a7f2916136ccf93101f36c34a17a4e5ef5d4f
    No-Presubmit: true
    No-Tree-Checks: true
    No-Try: true
    Bug: 862664
    Reviewed-on: https://chromium-review.googlesource.com/1153988Reviewed-by: default avatarScott Violet <sky@chromium.org>
    Commit-Queue: Scott Violet <sky@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#578856}
    a37ba3b9
browser_theme_pack.cc 55.5 KB