OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 // This test reflectively enumerates all the methods in the system and tries to | 5 // This test reflectively enumerates all the methods in the system and tries to |
6 // invoke them with various basic values (nulls, ints, etc). This may result in | 6 // invoke them with various basic values (nulls, ints, etc). This may result in |
7 // Dart exceptions or hangs, but should never result in crashes or JavaScript | 7 // Dart exceptions or hangs, but should never result in crashes or JavaScript |
8 // exceptions. | 8 // exceptions. |
9 | 9 |
10 library test.invoke_natives; | 10 library test.invoke_natives; |
(...skipping 19 matching lines...) Expand all Loading... |
30 new RegExp(r".*Sync$"), | 30 new RegExp(r".*Sync$"), |
31 | 31 |
32 // These prevent the test from exiting. | 32 // These prevent the test from exiting. |
33 'dart.io.sleep', | 33 'dart.io.sleep', |
34 'dart.io.HttpServer.HttpServer.listenOn', | 34 'dart.io.HttpServer.HttpServer.listenOn', |
35 | 35 |
36 // These either cause the VM to segfault or throw uncatchable API errors. | 36 // These either cause the VM to segfault or throw uncatchable API errors. |
37 // TODO(15274): Fix them and remove from blacklist. | 37 // TODO(15274): Fix them and remove from blacklist. |
38 'dart.io.SystemEncoding.decode', // Windows only | 38 'dart.io.SystemEncoding.decode', // Windows only |
39 'dart.io.SystemEncoding.encode', // Windows only | 39 'dart.io.SystemEncoding.encode', // Windows only |
| 40 |
| 41 // Don't call private methods in dart.async as they may circumvent the zoned |
| 42 // error handling below. |
| 43 new RegExp(r"^dart\.async\._.*$"), |
40 ]; | 44 ]; |
41 | 45 |
42 bool isBlacklisted(Symbol qualifiedSymbol) { | 46 bool isBlacklisted(Symbol qualifiedSymbol) { |
43 var qualifiedString = MirrorSystem.getName(qualifiedSymbol); | 47 var qualifiedString = MirrorSystem.getName(qualifiedSymbol); |
44 for (var pattern in blacklist) { | 48 for (var pattern in blacklist) { |
45 if (qualifiedString.contains(pattern)) { | 49 if (qualifiedString.contains(pattern)) { |
46 print('Skipping $qualifiedString'); | 50 print('Skipping $qualifiedString'); |
47 return true; | 51 return true; |
48 } | 52 } |
49 } | 53 } |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 0, 0xEFFFFFF, 0xFFFFFFFF, 0xFFFFFFFFFFFFFFFF, 3.14159, | 169 0, 0xEFFFFFF, 0xFFFFFFFF, 0xFFFFFFFFFFFFFFFF, 3.14159, |
166 "foo", 'blåbærgrød', 'Îñţérñåţîöñåļîžåţîờñ', "\u{1D11E}", #symbol]; | 170 "foo", 'blåbærgrød', 'Îñţérñåţîöñåļîžåţîờñ', "\u{1D11E}", #symbol]; |
167 valueObjects.forEach((v) => checkInstance(reflect(v), 'value object')); | 171 valueObjects.forEach((v) => checkInstance(reflect(v), 'value object')); |
168 | 172 |
169 uncaughtErrorHandler(self, parent, zone, error, stack) {}; | 173 uncaughtErrorHandler(self, parent, zone, error, stack) {}; |
170 var zoneSpec = | 174 var zoneSpec = |
171 new ZoneSpecification(handleUncaughtError: uncaughtErrorHandler); | 175 new ZoneSpecification(handleUncaughtError: uncaughtErrorHandler); |
172 testZone = Zone.current.fork(specification: zoneSpec); | 176 testZone = Zone.current.fork(specification: zoneSpec); |
173 testZone.createTimer(Duration.ZERO, doOneTask); | 177 testZone.createTimer(Duration.ZERO, doOneTask); |
174 } | 178 } |
OLD | NEW |