OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 library utils; | 5 library utils; |
6 | 6 |
| 7 import 'dart:async'; |
| 8 |
7 import '../../unittest/lib/unittest.dart'; | 9 import '../../unittest/lib/unittest.dart'; |
8 import '../../http/lib/http.dart' as http; | 10 import '../../http/lib/http.dart' as http; |
9 import '../../http/lib/testing.dart'; | 11 import '../../http/lib/testing.dart'; |
10 import '../lib/oauth2.dart' as oauth2; | 12 import '../lib/oauth2.dart' as oauth2; |
11 | 13 |
12 class ExpectClient extends MockClient { | 14 class ExpectClient extends MockClient { |
13 final Queue<MockClientHandler> _handlers; | 15 final Queue<MockClientHandler> _handlers; |
14 | 16 |
15 ExpectClient._(MockClientHandler fn) | 17 ExpectClient._(MockClientHandler fn) |
16 : _handlers = new Queue<MockClientHandler>(), | 18 : _handlers = new Queue<MockClientHandler>(), |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 | 75 |
74 /// A matcher for functions that throw ExpirationException. | 76 /// A matcher for functions that throw ExpirationException. |
75 const Matcher throwsExpirationException = | 77 const Matcher throwsExpirationException = |
76 const Throws(isExpirationException); | 78 const Throws(isExpirationException); |
77 | 79 |
78 class _ExpirationException extends TypeMatcher { | 80 class _ExpirationException extends TypeMatcher { |
79 const _ExpirationException() : super("ExpirationException"); | 81 const _ExpirationException() : super("ExpirationException"); |
80 bool matches(item, MatchState matchState) => | 82 bool matches(item, MatchState matchState) => |
81 item is oauth2.ExpirationException; | 83 item is oauth2.ExpirationException; |
82 } | 84 } |
OLD | NEW |