| Index: tools/telemetry/telemetry/results/gtest_test_results_unittest.py
|
| diff --git a/tools/telemetry/telemetry/results/gtest_test_results_unittest.py b/tools/telemetry/telemetry/results/gtest_test_results_unittest.py
|
| index 7175f10aa5de3b1806f736500b22023f7013b198..b7ad5a85ea23cd8f3c6476ef5cb4121d7423e4b8 100644
|
| --- a/tools/telemetry/telemetry/results/gtest_test_results_unittest.py
|
| +++ b/tools/telemetry/telemetry/results/gtest_test_results_unittest.py
|
| @@ -86,6 +86,18 @@ class GTestTestResultsTest(
|
| '1 FAILED TEST\n\n' % exception_trace)
|
| self.assertEquals(expected, ''.join(results.output_data))
|
|
|
| + def testSingleSkippedPage(self):
|
| + test_page_set = _MakePageSet()
|
| + results = SummaryGtestTestResults()
|
| + results.StartTest(test_page_set.pages[0])
|
| + self._mock_timer.SetTime(0.007)
|
| + results.AddSkip(test_page_set.pages[0], 'Page skipped for testing reason')
|
| + results.PrintSummary()
|
| + expected = ('[ RUN ] http://www.foo.com/\n'
|
| + '[ OK ] http://www.foo.com/ (7 ms)\n'
|
| + '[ PASSED ] 0 tests.\n\n')
|
| + self.assertEquals(expected, ''.join(results.output_data))
|
| +
|
| def testPassAndFailedPages(self):
|
| test_page_set = _MakePageSet()
|
| results = SummaryGtestTestResults()
|
| @@ -126,5 +138,27 @@ class GTestTestResultsTest(
|
| '2 FAILED TESTS\n\n' % (exception_trace, exception_trace))
|
| self.assertEquals(expected, ''.join(results.output_data))
|
|
|
| + def testStreamingResults(self):
|
| + test_page_set = _MakePageSet()
|
| + results = SummaryGtestTestResults()
|
| + exception = self.CreateException()
|
| +
|
| + results.StartTest(test_page_set.pages[0])
|
| + self._mock_timer.SetTime(0.007)
|
| + results.AddSuccess(test_page_set.pages[0])
|
| + expected = ('[ RUN ] http://www.foo.com/\n'
|
| + '[ OK ] http://www.foo.com/ (7 ms)\n')
|
| + self.assertEquals(expected, ''.join(results.output_data))
|
| +
|
| + results.StartTest(test_page_set.pages[1])
|
| + self._mock_timer.SetTime(0.009)
|
| + exception_trace = ''.join(traceback.format_exception(*exception))
|
| + results.AddError(test_page_set.pages[1], exception)
|
| + expected = ('[ RUN ] http://www.foo.com/\n'
|
| + '[ OK ] http://www.foo.com/ (7 ms)\n'
|
| + '[ RUN ] http://www.bar.com/\n'
|
| + '%s\n'
|
| + '[ FAILED ] http://www.bar.com/ (2 ms)\n' % exception_trace)
|
| +
|
| def tearDown(self):
|
| gtest_test_results.time.time = self._real_gtest_time_time
|
|
|