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


(Thunderbird :: Preferences, enhancement)

Not set


(Not tracked)

Thunderbird 57.0


(Reporter: jorgk, Assigned: jorgk)




(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:

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:

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 ?;)
Pushed by
wait for font pickers to populate asynchronously in test-font-chooser.js. r=jorgk
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.