Use createLocalSubfolder where possible in tests
Categories
(MailNews Core :: General, task)
Tracking
(thunderbird_esr115 unaffected)
| Tracking | Status | |
|---|---|---|
| thunderbird_esr115 | --- | unaffected |
People
(Reporter: darktrojan, Assigned: darktrojan)
References
Details
Attachments
(1 file, 1 obsolete file)
We have a pattern, especially in tests, of
- getting an
nsIMsgFolder - QIing it to
nsIMsgLocalMailFolder - calling
createLocalSubfolder - QIing that folder to
nsIMsgLocalMailFolder
so we can create sub-sub-folders or add messages. It'd be less of a mess if step 4 was unnecessary, since we know from steps 2 and 3 it must be a local folder.
| Assignee | ||
Comment 1•2 years ago
|
||
| Assignee | ||
Comment 2•2 years ago
|
||
Weirdly, although the two interfaces aren't related, the returned folder is already QIed to nsIMsgFolder so using the properties of that interface just works. There's some voodoo going on there I don't quite understand, but it makes life easier.
Updated•2 years ago
|
| Assignee | ||
Comment 3•2 years ago
|
||
I think I might abandon this idea. While it makes mochitests tidier to write (because of comment 2), in xpcshell tests that doesn't apply and folders have to be converted back to nsIMsgFolder all over the place. If we have to do a whole lot of converting, it should be from the more general interface to the more specific one.
| Assignee | ||
Comment 4•2 years ago
|
||
This is a less-ugly pattern, even if it is longer because of all the QueryInterface-ing.
Updated•2 years ago
|
| Assignee | ||
Updated•2 years ago
|
Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/a342b551ba91
Use createLocalSubfolder where possible in tests. r=leftmostcat
Description
•