Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 /// Test infrastructure for testing pub. Unlike typical unit tests, most pub | 5 /// Test infrastructure for testing pub. Unlike typical unit tests, most pub |
| 6 /// tests are integration tests that stage some stuff on the file system, run | 6 /// tests are integration tests that stage some stuff on the file system, run |
| 7 /// pub, and then validate the results. This library provides an API to build | 7 /// pub, and then validate the results. This library provides an API to build |
| 8 /// tests like that. | 8 /// tests like that. |
| 9 library test_pub; | 9 library test_pub; |
| 10 | 10 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 53 /// The current [HttpServer] created using [serve]. | 53 /// The current [HttpServer] created using [serve]. |
| 54 var _server; | 54 var _server; |
| 55 | 55 |
| 56 /// The list of paths that have been requested from the server since the last | 56 /// The list of paths that have been requested from the server since the last |
| 57 /// call to [getRequestedPaths]. | 57 /// call to [getRequestedPaths]. |
| 58 final _requestedPaths = <String>[]; | 58 final _requestedPaths = <String>[]; |
| 59 | 59 |
| 60 /// The cached value for [_portCompleter]. | 60 /// The cached value for [_portCompleter]. |
| 61 Completer<int> _portCompleterCache; | 61 Completer<int> _portCompleterCache; |
| 62 | 62 |
| 63 /// A [Matcher] that matches JavaScript generated by dart2js with minification | |
| 64 /// enabled. | |
| 65 Matcher minifiedDart2JSOutput = | |
|
nweiz
2013/10/29 23:18:53
These should follow the matcher naming convention
Bob Nystrom
2013/10/29 23:53:25
Done.
| |
| 66 isNot(contains("// The code supports the following hooks")); | |
| 67 | |
| 68 /// A [Matcher] that matches JavaScript generated by dart2js with minification | |
| 69 /// disabled. | |
| 70 Matcher unminifiedDart2JSOutput = | |
| 71 contains("// The code supports the following hooks"); | |
| 72 | |
| 63 /// The completer for [port]. | 73 /// The completer for [port]. |
| 64 Completer<int> get _portCompleter { | 74 Completer<int> get _portCompleter { |
| 65 if (_portCompleterCache != null) return _portCompleterCache; | 75 if (_portCompleterCache != null) return _portCompleterCache; |
| 66 _portCompleterCache = new Completer<int>(); | 76 _portCompleterCache = new Completer<int>(); |
| 67 currentSchedule.onComplete.schedule(() { | 77 currentSchedule.onComplete.schedule(() { |
| 68 _portCompleterCache = null; | 78 _portCompleterCache = null; |
| 69 }, 'clearing the port completer'); | 79 }, 'clearing the port completer'); |
| 70 return _portCompleterCache; | 80 return _portCompleterCache; |
| 71 } | 81 } |
| 72 | 82 |
| (...skipping 763 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 836 bool matches(item, Map matchState) { | 846 bool matches(item, Map matchState) { |
| 837 if (item is! Pair) return false; | 847 if (item is! Pair) return false; |
| 838 return _firstMatcher.matches(item.first, matchState) && | 848 return _firstMatcher.matches(item.first, matchState) && |
| 839 _lastMatcher.matches(item.last, matchState); | 849 _lastMatcher.matches(item.last, matchState); |
| 840 } | 850 } |
| 841 | 851 |
| 842 Description describe(Description description) { | 852 Description describe(Description description) { |
| 843 description.addAll("(", ", ", ")", [_firstMatcher, _lastMatcher]); | 853 description.addAll("(", ", ", ")", [_firstMatcher, _lastMatcher]); |
| 844 } | 854 } |
| 845 } | 855 } |
| OLD | NEW |