Commit 38542d2e authored by Emily Stark's avatar Emily Stark Committed by Commit Bot

Simplified domain: fix some test oddities

This CL fixes a few oddities in the omnibox tests for the simplified
domain field trials.

- The main fix is to make ExpectElidedToSimplifiedDomain() not
  sensitive to the rounding behavior of GetSubstringBounds(), which is
  changing in a follow-up CL
  (https://chromium-review.googlesource.com/c/chromium/src/+/2317820).
  Previously we were checking that the display offset is correct by
  comparing it to the width of the string that should be scrolled
  offscreen, but that won't work when GetSubstringBounds() is
  subsequently changed to round outwards so that adjacent substrings'
  bounds can overlap slightly -- this makes the width of the portion
  scrolled offscreen slightly larger than the actual display offset.
  Instead, we now compare the x value of what should be visible with
  the x value of what should be offscreen to check that the display
  offset is correct.

- Along the way I noticed that one of the checks in
  ExpectElidedToSimplifiedDomain() was bogus, so I fixed that.

- And I noticed that the URL wasn't set properly (it had an extra
  scheme appended to it) in SetUpSimplifiedDomainTest(). This didn't
  really matter because all the code looks at the display URL (which
  was set properly) rather than the actual URL, but I fixed it anyway.

Bug: 1108045
Change-Id: I4c233ce8485b5e09613cac7f268f4b3abc87b142
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2332581Reviewed-by: default avatarJustin Donnelly <jdonnelly@chromium.org>
Commit-Queue: Emily Stark <estark@chromium.org>
Cr-Commit-Position: refs/heads/master@{#793669}
parent 67c54d61
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment