Support fine grained control over event dispatch during testing