Closed Bug 1803980 Opened 2 years ago Closed 2 years ago

UrlbarValueFormatter generates confusing console logs in tests when resizing window

Categories

(Firefox :: Address Bar, defect)

defect

Tracking

()

RESOLVED FIXED
109 Branch
Tracking Status
firefox109 --- fixed

People

(Reporter: aminomancer, Assigned: aminomancer)

Details

Attachments

(1 file)

See here for a frequent example.

The code path for this issue goes like this:

  1. The browser test resizes the window, which apparently can happen while the urlbar input is valueless
  2. Resizing invokes UrlbarValueFormatter's resize handler
  3. This calls _ensureFormattedHostVisible with no metadata argument after 100ms,
  4. which calls _getUrlMetaData,
  5. which calls Services.uriFixup.getFixupURIInfo (passing the input value, which is undefined at this point),
  6. which explicitly throws if no url is passed.
  7. Although the exception is technically handled by the trycatch block in _getUrlMetaData, that apparently doesn't prevent it from being logged (I'm assuming but don't actually know if that's expected behavior in general).

Idk exactly why the input value is undefined — looking at the context of the test, it seems like at every point when the window is resized the urlbar input value should be about:firefoxview. But clearly I'm missing something. I thought maybe it was the cleanup function, which does call resizeTo on the window after the Firefox View tab is closed up. But that should happen after the whole test file is finished, which doesn't match with the test logs I've been seeing.

In any case, I think there's a pretty simple fix here to just return before calling Services.uriFixup.getFixupURIInfo if the url is null.

Assignee: nobody → shughes
Status: NEW → ASSIGNED
Pushed by shughes@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/cb9ac51ccbe5 Fix urlbar window resize error logs. r=adw
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 109 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: