Closed Bug 1399443 Opened 2 years ago Closed 2 years ago

TEST-UNEXPECTED-FAIL | C:\slave\test\build\tests\mozmill\pref-window\test-font-chooser.js

Categories

(Thunderbird :: Preferences, enhancement)

enhancement
Not set

Tracking

(Not tracked)

RESOLVED FIXED
Thunderbird 57.0

People

(Reporter: jorgk, Assigned: jorgk)

References

Details

Attachments

(1 file, 2 obsolete files)

+++ This bug was initially created as a clone of Bug #1399206 +++

Caused by bug 1399206 and bug 1375978.

TEST-UNEXPECTED-FAIL | C:\slave\test\build\tests\mozmill\pref-window\test-font-chooser.js | test-font-chooser.js::test_font_name_displayed
TEST-UNEXPECTED-FAIL | C:\slave\test\build\tests\mozmill\pref-window\test-font-chooser.js | test-font-chooser.js::test_font_name_not_present

Log says:
EXCEPTION: The serif font should be Aharoni, but nothing is actually selected.
EXCEPTION: The serif font should be Times New Roman, but nothing is actually selected.

Looks like we need to adapt the test to the async loading of fonts now.
Aceman, any idea how to do this?
Flags: needinfo?(acelists)
Arai, could you lend a hand here? How do I convert this to async, see patch? I noticed we have async functions in Mozmill:

https://dxr.mozilla.org/comm-central/rev/aa24e45307629490b15ad5165aa8b584cdb758c0/mail/test/mozmill/session-store/test-session-store.js#389

Thanks in advance.
Flags: needinfo?(arai.unmht)
Looks like the sync interface to build the font list is still there, but the panel hasn't fully loaded by the time we query it.
Flags: needinfo?(arai.unmht)
async function returns promise, so you need to handle it on caller, the setupModule function,
either returning the value returned by buildFontList call, or make setupModule also an async function and await on it.

either way, the caller of setupModule should also handle the promise returned by it.
so, I guess entire the module system needs to become async.
Comment on attachment 8907573 [details] [diff] [review]
1399443-test-font-chooser.patch - WIP, not working

I think this patch is on the wrong track, the sync function EnumerateFonts() still exists:
https://hg.mozilla.org/mozilla-central/rev/f255ec4e8c36#l5.8

The error we're getting is not "unknown function" but something else. Observing the test, the panel hasn't fully loaded.
Attachment #8907573 - Attachment is obsolete: true
Attached patch 1399443-test-font-chooser2.patch (obsolete) — Splinter Review
This fixes the test. I'm sure Aceman has a better fix than this.
Attached patch 1399443.patchSplinter Review
Patch provided by Aceman via PM and IRC. The master at work ;-)
Attachment #8907669 - Attachment is obsolete: true
Flags: needinfo?(acelists)
Attachment #8907783 - Flags: review+
Do I get bonus points for converting to EnumerateFontsAsync ?;)
Absolutely!!
Pushed by mozilla@jorgk.com:
https://hg.mozilla.org/comm-central/rev/ca41eb0d202f
wait for font pickers to populate asynchronously in test-font-chooser.js. r=jorgk
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 57.0
You need to log in before you can comment on or make changes to this bug.