TB24 inclusion for new minor feature (thread-sorting pref)

Andrew Sutherland asutherland at asutherland.org
Mon Aug 12 15:25:55 UTC 2013


On 08/12/2013 08:32 AM, The Wanderer wrote:
> B, the most closely related existing tests (and thus, most adaptable
> existing code) are xpcshell-based - but not only does this not sound
> like the sort of test which fits under the umbrella of what MDN
> describes as xpcshell's domain, I don't have my head around xpcshell. At
> the very least, I'd probably need a fair bit of hand-holding through
> parts of the process.

http://mxr.mozilla.org/comm-central/source/mailnews/base/test/unit/test_nsMsgDBView.js 
which is probably what you found is indeed the right place to test 
this.  Specifically, it's preferable to test nsMsgDBView code in 
mailnews tests rather than Thunderbird-specific tests.  It's also 
preferable to test it using xpcshell since there are a number of 
permutations that affect it and by testing it in relative isolation 
allows it to be directly driven without worrying about things that 
should be irrelevant to the test (like screen size), higher level 
abstractions like the DBViewWrapper or FolderDisplayWidget, etc.

There is some documentation on the framework used in that test here:
https://developer.mozilla.org/en-US/docs/MailNews/AsyncTestUtils_Extended_Framework

In terms of your debug cycle; you absolutely shouldn't need to do a 
clean make every time you want to run the test.  The test files should 
be symlinked.  You should be able to just re-run the test after changing 
the JS file as per the yellow box about "check-one" at the top of 
https://developer.mozilla.org/en-US/docs/Writing_xpcshell-based_unit_tests. 
It sounds like you found that box, but there are extenuating 
circumstances per your comment in 
https://bugzilla.mozilla.org/show_bug.cgi?id=890877.  My suggestion 
would be to use 'make' to build instead; the 'mach' support in 
comm-central is very new, so it's not entirely surprising that it would 
die on things other than straight-up Ubuntu or the like, but I 
understand how badly that sucks and what a frustrating maze it can be :(

Andrew



More information about the tb-planning mailing list