Fake of the total-timeout observer that just stops after counting "count" number of test or result events.
| 598 | |
| 599 | |
| 600 | class FakeTimeoutProc(base.TestProcObserver): |
| 601 | """Fake of the total-timeout observer that just stops after counting |
| 602 | "count" number of test or result events. |
| 603 | """ |
| 604 | def __init__(self, count): |
| 605 | super(FakeTimeoutProc, self).__init__() |
| 606 | self._n = 0 |
| 607 | self._count = count |
| 608 | |
| 609 | def _on_next_test(self, test): |
| 610 | self.__on_event() |
| 611 | |
| 612 | def _on_result_for(self, test, result): |
| 613 | self.__on_event() |
| 614 | |
| 615 | def __on_event(self): |
| 616 | if self._n >= self._count: |
| 617 | self.stop() |
| 618 | self._n += 1 |
| 619 | |
| 620 | |
| 621 | class NumFuzzerTest(TestRunnerTest): |
no outgoing calls