Fix incorrect assertion message in browser_adoptTab_failure.js
Categories
(Firefox :: Tabbed Browser, task)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox158 | --- | fixed |
People
(Reporter: v-racine, Assigned: v-racine)
Details
(Keywords: good-first-bug, Whiteboard: [lang=js])
Attachments
(1 file)
|
Bug 2069534 - Correct the assertion message in browser_adoptTab_failure.js. r?#tabbrowser-reviewers!
48 bytes,
text/x-phabricator-request
|
Details | Review |
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");
| Assignee | ||
Updated•24 days ago
|
Comment 1•20 days ago
|
||
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 | ||
Comment 2•20 days ago
|
||
Updated•20 days ago
|
| Assignee | ||
Comment 3•20 days ago
|
||
Thanks for confirming, :Oriol. That matches the surrounding assertions.
The patch is up for review.
Description
•