Chromium Code Reviews| Index: pkg/unittest/lib/html_config.dart |
| diff --git a/pkg/unittest/lib/html_config.dart b/pkg/unittest/lib/html_config.dart |
| index 2246bf33ea76df6700dd4e8fced2854d85593d0e..5380c8387c86a6f2d202ba42c890fb8b3f34ccfe 100644 |
| --- a/pkg/unittest/lib/html_config.dart |
| +++ b/pkg/unittest/lib/html_config.dart |
| @@ -51,6 +51,10 @@ void _showResultsInPage(int passed, int failed, int errors, |
| } |
| newBody.write("</tbody></table>"); |
| document.body.innerHtml = newBody.toString(); |
| + |
| + window.onHashChange.listen((_) { |
| + window.location.reload(); |
| + }); |
| } |
| } |
| @@ -68,7 +72,7 @@ String _toHtml(TestCase test_) { |
| <tr> |
| <td>${test_.id}</td> |
| <td class="unittest-${test_.result}">${test_.result.toUpperCase()}</td> |
| - <td>Expectation: ${test_.description}. ${_htmlEscape(test_.message)}</td> |
| + <td>Expectation: <a href="#testFilter=${test_.description}">${test_.description}</a>. ${_htmlEscape(test_.message)}</td> |
| </tr>'''; |
| if (test_.stackTrace != null) { |
| @@ -126,6 +130,20 @@ class HtmlConfiguration extends Configuration { |
| window.postMessage('unittest-suite-wait-for-done', '*'); |
| } |
| + void onStart() { |
| + var hash = window.location.hash; |
| + if (hash != null && hash.length > 1) { |
| + var params = hash.substring(1).split('&'); |
| + for (var param in params) { |
| + var parts = param.split('='); |
| + if (parts.length == 2 && parts[0] == 'testFilter') { |
| + filterTests('^${parts[1]}'); |
|
gram
2013/03/14 18:39:08
This is cool, but can you add some comments as to
blois
2013/03/14 21:37:19
Done.
|
| + } |
| + } |
| + } |
| + super.onStart(); |
| + } |
| + |
| void onSummary(int passed, int failed, int errors, List<TestCase> results, |
| String uncaughtError) { |
| _showResultsInPage(passed, failed, errors, results, _isLayoutTest, |