Closed Bug 2069534 Opened 24 days ago Closed 18 days ago

Fix incorrect assertion message in browser_adoptTab_failure.js

Categories

(Firefox :: Tabbed Browser, task)

task

Tracking

()

RESOLVED FIXED
158 Branch
Tracking Status
firefox158 --- fixed

People

(Reporter: v-racine, Assigned: v-racine)

Details

(Keywords: good-first-bug, Whiteboard: [lang=js])

Attachments

(1 file)

In browser/components/tabbrowser/test/browser/tabs/browser_adoptTab_failure.js, an assertion checks for 2 multiselected tabs, but its message says "Three":

is(gBrowser2.multiSelectedTabsCount, 2, "Three multiselected tabs");

The value of 2 is correct. The three assertions immediately below it confirm that exactly two tabs are multiselected:

ok(gBrowser2.tabs[0].multiselected, "Tab 0 is multiselected");
ok(gBrowser2.tabs[1].multiselected, "Tab 1 is multiselected");
ok(!gBrowser2.tabs[2].multiselected, "Tab 2 is not multiselected");

So only the message needs changing to "Two multiselected tabs".

Link to the code:
https://searchfox.org/firefox-main/rev/5c2121970343686aaa2a9f07dd5d3b722d624073/browser/components/tabbrowser/test/browser/tabs/browser_adoptTab_failure.js#76

To verify the fix:

./mach mochitest --headless browser/components/tabbrowser/test/browser/tabs/browser_adoptTab_failure.js

The test should pass either way since only the message text changes. The check is that the test still passes and the message now matches what is being asserted.

This bug depends on bug 1498714, which renames multiSelectedTabsCount to selectedTabsCount on this same line. Both patches touch line 76, so this one should land after. Once bug 1498714 lands, the line will read:

is(gBrowser2.selectedTabsCount, 2, "Three multiselected tabs");

Mentor: vracine21
Depends on: 1498714
Keywords: good-first-bug
Whiteboard: [lang=js]
Mentor: vracine21
No longer depends on: 1498714

Possibly I initially had one extra tab when I was writing the test, but when I removed it, I forgot to update this message.

Assignee: nobody → vracine21
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true

Thanks for confirming, :Oriol. That matches the surrounding assertions.
The patch is up for review.

Pushed by jsudiaman@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/52a3c5d47c19 https://hg.mozilla.org/integration/autoland/rev/f42c040a0947 Correct the assertion message in browser_adoptTab_failure.js. r=tabbrowser-reviewers,jsudiaman,jswinarton
Status: ASSIGNED → RESOLVED
Closed: 18 days ago
Resolution: --- → FIXED
Target Milestone: --- → 158 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: