Geoff, a question: do try/catch blocks screw up async test stuff implemented with yield and generator functions?
It's this block here:
The yield a few lines down doesn't seem to be waiting for the asyncUrlListener to trigger.
Been poking at this all day and now I've got a big JS headache :-)
I think the bug is actually the test falling over rather than the actual maildir code.
The test uses asyncUrlListener to wait for nsIMsgLocalFolder.getDatabaseWithReparse() to complete.
The core of the reparse is handled by
The mbox implementation seems to complete before getDatabaseWithReparse() returns. But the maildir version is driven off a timer callback, so I don't think it even starts before getDatabaseWithReparse() returns. This should be OK - it'll just return NS_ERROR_NOT_INITIALIZED to let us know the database isn't ready yet. The test checks for this error... but I think the try/catch block is screwing things up.
If the exception is thrown, the next yield doesn't seem to wait correctly for asyncListener.
The attached patch adds some dump() calls in to show the asyncUrlListener callbacks, and to show what the test is doing. I can see that the yield returns before the asyncUrlListener.OnStopRunningUrl() is invoked.