Fix (and speed up) some completion tests.
Review Request #109654 - Created March 22, 2013 and submitted
|Simon St James|
We're currently waiting around for a fixed time period for the completion widget to become either active or inactive, which is timing-sensitive and needlessly slow. This patch introduces some helper methods which simply process events and poll the completion widget status until it is in the state we want or until we time out. These helper methods are currently used only in invokeCompletionBox and the two previously failing tests, testAbortInvalidText and testAbortController, but I'd recommend them to be used everywhere where they make sense in the completion_tests. The only plausible case I can think of where they wouldn't "make sense" is in cases where we explicitly want to query the status of the completion box *only after* a specific time delay has passed e.g. perhaps a test that the completion box doesn't pop up until after the time delay specified by the user. I'm not fully comfortable amending all tests in this way, so I'll leave it to someone who is :) I've tested that the two altered tests are still valid by purposefully breaking them and ensuring they then still fail in the expected way. With this patch, all completion_test test now pass.
Manually broke the affected tests and ensured they still failed in the expected way.