Closed Bug 1968629 Opened 3 months ago Closed 3 months ago

Make browser_dbg-editor-scroll.js stable

Categories

(DevTools :: Debugger, defect)

defect

Tracking

(firefox141 fixed)

RESOLVED FIXED
141 Branch
Tracking Status
firefox141 --- fixed

People

(Reporter: hiro, Assigned: hiro)

References

Details

Attachments

(2 files)

Though the test failed when I landed the change for bug 1674687 (see bug 1674687 comment 12), I can see (probably) the same error when I run the test locally without any change.

devtools/client/debugger/test/mochitest/browser_dbg-editor-scroll.js
FAIL The new first line is visible -
Stack trace:
chrome://mochikit/content/browser-test.js:test_ok:1626
chrome://mochitests/content/browser/devtools/client/debugger/test/mochitest/browser_dbg-editor-scroll.js:testIsPositionVisible:195
chrome://mochikit/content/browser-test.js:handleTask:1170
chrome://mochikit/content/browser-test.js:_runTaskBasedTest:1242
chrome://mochikit/content/browser-test.js:Tester_execTest:1383
chrome://mochikit/content/browser-test.js:nextTest/<:1159
chrome://mochikit/content/tests/SimpleTest/SimpleTest.js:SimpleTest.waitForFocus/<:1058

On my linux (wayland) environment, at this line;

inYView = coords.top > y && coords.bottom < y + height;

The coords.top is 25.449996948242188, wheares y is 29.

Hey Alexandre or Hubert, I think in this test getFirstVisibleLine might return lines where it's partially visible. So I think we should ok(isScrolledPositionVisible(dbg, firstLine + 1) rather than isScrolledPositionVisible(dbg, firstLine)?

Flags: needinfo?(poirot.alex)
Flags: needinfo?(hmanilla)
Blocks: 1674687

Just for a reference, this is the change what I have in my mind.

Hi :hiro

Sorry about you facing issues with this test...
I tried very hard to make this test deterministic and reliable, but it is actually brittle.
You are proving with bug 1674687 that is can easily be impacted by platform changes.

So feel free to change the assertion to whatever state we end up with.
The important thing is to assert that the scroll is overall correct. The very precise line and column we scroll to isn't critical as it can easily change based on font rendering which changes easily based on the OS/environment.

Flags: needinfo?(poirot.alex)
Flags: needinfo?(hmanilla)

Thank you, Alexandre!

It's possible that the line returned by getFirstVisibleLine may be
partially visible.

Assignee: nobody → hikezoe.birchill
Status: NEW → ASSIGNED
Pushed by hikezoe.birchill@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/56819b15acf4 https://hg.mozilla.org/integration/autoland/rev/0152c4e74def Check the next line of the first visible line in browser_dbg-editor-scroll.js. r=ochameau,devtools-reviewers
Status: ASSIGNED → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → 141 Branch
QA Whiteboard: [qa-triage-done-c142/b141]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: