| 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 import 'dart:convert'; | 5 import 'dart:convert'; |
| 6 | 6 |
| 7 import 'package:expect/expect.dart'; | 7 import 'package:expect/expect.dart'; |
| 8 | 8 |
| 9 // This test implements a new special interface that can be used to | 9 // This test implements a new special interface that can be used to |
| 10 // send data more efficiently between two converters. | 10 // send data more efficiently between two converters. |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 } | 25 } |
| 26 | 26 |
| 27 class IntAdapterSink extends MyChunkedIntSink { | 27 class IntAdapterSink extends MyChunkedIntSink { |
| 28 final _sink; | 28 final _sink; |
| 29 IntAdapterSink(this._sink); | 29 IntAdapterSink(this._sink); |
| 30 add(o) => _sink.add(o); | 30 add(o) => _sink.add(o); |
| 31 close() => _sink.close(); | 31 close() => _sink.close(); |
| 32 specialI(o) => add(o); | 32 specialI(o) => add(o); |
| 33 } | 33 } |
| 34 | 34 |
| 35 class MyChunkedBoolSink extends ChunkedConversionSink<bool> { | 35 abstract class MyChunkedBoolSink extends ChunkedConversionSink<bool> { |
| 36 MyChunkedBoolSink(); | 36 MyChunkedBoolSink(); |
| 37 factory MyChunkedBoolSink.from(sink) = BoolAdapterSink; | 37 factory MyChunkedBoolSink.from(sink) = BoolAdapterSink; |
| 38 factory MyChunkedBoolSink.withCallback(callback) { | 38 factory MyChunkedBoolSink.withCallback(callback) { |
| 39 var sink = new ChunkedConversionSink.withCallback(callback); | 39 var sink = new ChunkedConversionSink.withCallback(callback); |
| 40 return new MyChunkedBoolSink.from(sink); | 40 return new MyChunkedBoolSink.from(sink); |
| 41 } | 41 } |
| 42 | 42 |
| 43 add(bool b); | 43 add(bool b); |
| 44 close(); | 44 close(); |
| 45 | 45 |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 intSink.add(-3); | 245 intSink.add(-3); |
| 246 intSink.add(3); | 246 intSink.add(3); |
| 247 intSink.close(); | 247 intSink.close(); |
| 248 Expect.isTrue(hasExecuted); | 248 Expect.isTrue(hasExecuted); |
| 249 Expect.equals(0, specialBCounter); | 249 Expect.equals(0, specialBCounter); |
| 250 specialBCounter = 0; | 250 specialBCounter = 0; |
| 251 Expect.equals(1, specialICounter); | 251 Expect.equals(1, specialICounter); |
| 252 specialICounter = 0; | 252 specialICounter = 0; |
| 253 hasExecuted = false; | 253 hasExecuted = false; |
| 254 } | 254 } |
| OLD | NEW |