| 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 library barback.test.asset_test; | 5 library barback.test.asset_test; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:convert'; | 8 import 'dart:convert'; |
| 9 import 'dart:io'; | 9 import 'dart:io'; |
| 10 import 'dart:isolate'; | 10 import 'dart:isolate'; |
| 11 | 11 |
| 12 import 'package:barback/barback.dart'; | 12 import 'package:barback/barback.dart'; |
| 13 import 'package:barback/src/internal_asset.dart'; | 13 import 'package:barback/src/asset/internal_asset.dart'; |
| 14 import 'package:path/path.dart' as pathos; | 14 import 'package:path/path.dart' as pathos; |
| 15 import 'package:unittest/unittest.dart'; | 15 import 'package:unittest/unittest.dart'; |
| 16 | 16 |
| 17 import 'utils.dart'; | 17 import 'utils.dart'; |
| 18 | 18 |
| 19 /// The contents of the test binary file. | 19 /// The contents of the test binary file. |
| 20 final binaryContents = [0, 1, 2, 3, 4]; | 20 final binaryContents = [0, 1, 2, 3, 4]; |
| 21 | 21 |
| 22 main() { | 22 main() { |
| 23 initConfig(); | 23 initConfig(); |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 }); | 259 }); |
| 260 }); | 260 }); |
| 261 } | 261 } |
| 262 | 262 |
| 263 void _getAssetBytes(message) { | 263 void _getAssetBytes(message) { |
| 264 var asset = deserializeAsset(message['asset']); | 264 var asset = deserializeAsset(message['asset']); |
| 265 var builder = asset.read().fold(new BytesBuilder(), | 265 var builder = asset.read().fold(new BytesBuilder(), |
| 266 (builder, chunk) => builder..add(chunk)); | 266 (builder, chunk) => builder..add(chunk)); |
| 267 builder.then((builder) => message['replyTo'].send(builder.takeBytes())); | 267 builder.then((builder) => message['replyTo'].send(builder.takeBytes())); |
| 268 } | 268 } |
| OLD | NEW |