Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(282)

Side by Side Diff: tests/lib_strong/convert/streamed_conversion_json_utf8_encode_test.dart

Issue 2779843004: Fix top-level inference errors for most of the newly failing tests. (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "package:expect/expect.dart"; 5 import "package:expect/expect.dart";
6 import 'dart:async'; 6 import 'dart:async';
7 import 'dart:convert'; 7 import 'dart:convert';
8 import 'json_unicode_tests.dart'; 8 import 'json_unicode_tests.dart';
9 import "package:async_helper/async_helper.dart"; 9 import "package:async_helper/async_helper.dart";
10 10
11 final JSON_UTF8 = JSON.fuse(UTF8); 11 final JSON_UTF8 = JSON.fuse<List<int>>(UTF8);
12 12
13 13
14 Stream<List<int>> encode(Object o) { 14 Stream<List<int>> encode(Object o) {
15 var controller; 15 var controller;
16 controller = new StreamController(onListen: () { 16 controller = new StreamController(onListen: () {
17 controller.add(o); 17 controller.add(o);
18 controller.close(); 18 controller.close();
19 }); 19 });
20 return controller.stream.transform(JSON_UTF8.encoder); 20 return controller.stream.transform(JSON_UTF8.encoder);
21 } 21 }
(...skipping 22 matching lines...) Expand all
44 } 44 }
45 45
46 void main() { 46 void main() {
47 for (var test in JSON_UNICODE_TESTS) { 47 for (var test in JSON_UNICODE_TESTS) {
48 var expected = test[0]; 48 var expected = test[0];
49 var object = test[1]; 49 var object = test[1];
50 testUnpaused(expected, encode(object)); 50 testUnpaused(expected, encode(object));
51 testWithPauses(expected, encode(object)); 51 testWithPauses(expected, encode(object));
52 } 52 }
53 } 53 }
OLDNEW
« no previous file with comments | « tests/lib_strong/convert/streamed_conversion_json_utf8_decode_test.dart ('k') | tests/lib_strong/lib_strong.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698