• Etienne Bergeron's avatar
    Rewrite ElideText unittests · 8f462482
    Etienne Bergeron authored
    This CL is rewriting the ElideText unittests.
    The goal of this rewrite is to allow adding more unittests.
      * ELIDE_HEAD
      * ELIDE_EMAIL
      * ELIDE_MIDDLE
      * Eliding with styles
    
    It is now using a templated tests to ease debugging.
    
    A change to the way glyph_width_for_test_ work was needed.
    Zero width codepoints will stay zero width, even if a
    glyph width is provided. This is required to ensures
    RLM and LRM (directional marker) stay with width zero.
    Otherwise a DCHECK is failing since the text can be larger
    with eliding (2 glyphs instead of 1 glyph).
    
    Bug: 1025561
    Change-Id: I19f18fb99f52edbbb59d170f7b47bef3a3f3de5f
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1975056
    Commit-Queue: Etienne Bergeron <etienneb@chromium.org>
    Reviewed-by: default avatarPeter Kasting <pkasting@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#726406}
    8f462482
render_text_harfbuzz.cc 91.9 KB