| 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 /// The current [HttpServer] created using [serve]. | 49 /// The current [HttpServer] created using [serve]. |
| 50 var _server; | 50 var _server; |
| 51 | 51 |
| 52 /// The list of paths that have been requested from the server since the last | 52 /// The list of paths that have been requested from the server since the last |
| 53 /// call to [getRequestedPaths]. | 53 /// call to [getRequestedPaths]. |
| 54 final _requestedPaths = <String>[]; | 54 final _requestedPaths = <String>[]; |
| 55 | 55 |
| 56 /// The cached value for [_portCompleter]. | 56 /// The cached value for [_portCompleter]. |
| 57 Completer<int> _portCompleterCache; | 57 Completer<int> _portCompleterCache; |
| 58 | 58 |
| 59 /// A [Matcher] that matches JavaScript generated by dart2js with minification |
| 60 /// enabled. |
| 61 Matcher isMinifiedDart2JSOutput = |
| 62 isNot(contains("// The code supports the following hooks")); |
| 63 |
| 64 /// A [Matcher] that matches JavaScript generated by dart2js with minification |
| 65 /// disabled. |
| 66 Matcher isUnminifiedDart2JSOutput = |
| 67 contains("// The code supports the following hooks"); |
| 68 |
| 59 /// The completer for [port]. | 69 /// The completer for [port]. |
| 60 Completer<int> get _portCompleter { | 70 Completer<int> get _portCompleter { |
| 61 if (_portCompleterCache != null) return _portCompleterCache; | 71 if (_portCompleterCache != null) return _portCompleterCache; |
| 62 _portCompleterCache = new Completer<int>(); | 72 _portCompleterCache = new Completer<int>(); |
| 63 currentSchedule.onComplete.schedule(() { | 73 currentSchedule.onComplete.schedule(() { |
| 64 _portCompleterCache = null; | 74 _portCompleterCache = null; |
| 65 }, 'clearing the port completer'); | 75 }, 'clearing the port completer'); |
| 66 return _portCompleterCache; | 76 return _portCompleterCache; |
| 67 } | 77 } |
| 68 | 78 |
| (...skipping 762 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 831 bool matches(item, Map matchState) { | 841 bool matches(item, Map matchState) { |
| 832 if (item is! Pair) return false; | 842 if (item is! Pair) return false; |
| 833 return _firstMatcher.matches(item.first, matchState) && | 843 return _firstMatcher.matches(item.first, matchState) && |
| 834 _lastMatcher.matches(item.last, matchState); | 844 _lastMatcher.matches(item.last, matchState); |
| 835 } | 845 } |
| 836 | 846 |
| 837 Description describe(Description description) { | 847 Description describe(Description description) { |
| 838 description.addAll("(", ", ", ")", [_firstMatcher, _lastMatcher]); | 848 description.addAll("(", ", ", ")", [_firstMatcher, _lastMatcher]); |
| 839 } | 849 } |
| 840 } | 850 } |
| OLD | NEW |