| 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 11 matching lines...) Expand all Loading... |
| 22 | 22 |
| 23 // Don't change the exit code, which may fool the test harness. | 23 // Don't change the exit code, which may fool the test harness. |
| 24 'dart.io.exitCode', | 24 'dart.io.exitCode', |
| 25 | 25 |
| 26 // Don't run blocking io calls. | 26 // Don't run blocking io calls. |
| 27 new RegExp(r".*Sync$"), | 27 new RegExp(r".*Sync$"), |
| 28 | 28 |
| 29 // These prevent the test from exiting. | 29 // These prevent the test from exiting. |
| 30 'dart.io.sleep', | 30 'dart.io.sleep', |
| 31 'dart.io.HttpServer.HttpServer.listenOn', | 31 'dart.io.HttpServer.HttpServer.listenOn', |
| 32 new RegExp('dart\.io\..*'), /// smi: ok | |
| 33 new RegExp('dart\.io\._Timer\..*'), | |
| 34 new RegExp('dart\.isolate\..*'), | |
| 35 | |
| 36 // Runtime exceptions we can't catch because they occur too early in event | |
| 37 // dispatch to be caught in a zone. | |
| 38 'dart.io._Timer._createTimer', /// smi: ok | |
| 39 'dart.async.runZoned', /// string: ok | |
| 40 'dart.async._ScheduleImmediate._closure', | |
| 41 | 32 |
| 42 // These either cause the VM to segfault or throw uncatchable API errors. | 33 // These either cause the VM to segfault or throw uncatchable API errors. |
| 43 // TODO(15274): Fix them and remove from blacklist. | 34 // TODO(15274): Fix them and remove from blacklist. |
| 44 'dart.io._IOService.dispatch', | |
| 45 'dart.io._IOService._initialize', | |
| 46 'dart.io._IOService._finalize', | |
| 47 'dart.io._StdIOUtils._socketType', | |
| 48 'dart.io._StdIOUtils._getStdioOutputStream', | |
| 49 'dart.io._Filter.newZLibInflateFilter', | |
| 50 'dart.io._Filter.newZLibDeflateFilter', | |
| 51 'dart.io._FileSystemWatcher._listenOnSocket', | |
| 52 'dart.io.SystemEncoding.decode', // Windows only | 35 'dart.io.SystemEncoding.decode', // Windows only |
| 53 'dart.io.SystemEncoding.encode', // Windows only | 36 'dart.io.SystemEncoding.encode', // Windows only |
| 54 ]; | 37 ]; |
| 55 | 38 |
| 56 bool isBlacklisted(Symbol qualifiedSymbol) { | 39 bool isBlacklisted(Symbol qualifiedSymbol) { |
| 57 var qualifiedString = MirrorSystem.getName(qualifiedSymbol); | 40 var qualifiedString = MirrorSystem.getName(qualifiedSymbol); |
| 58 for (var pattern in blacklist) { | 41 for (var pattern in blacklist) { |
| 59 if (qualifiedString.contains(pattern)) { | 42 if (qualifiedString.contains(pattern)) { |
| 60 print('Skipping $qualifiedString'); | 43 print('Skipping $qualifiedString'); |
| 61 return true; | 44 return true; |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 0, 0xEFFFFFF, 0xFFFFFFFF, 0xFFFFFFFFFFFFFFFF, 3.14159, | 162 0, 0xEFFFFFF, 0xFFFFFFFF, 0xFFFFFFFFFFFFFFFF, 3.14159, |
| 180 "foo", 'blåbærgrød', 'Îñţérñåţîöñåļîžåţîờñ', "\u{1D11E}", #symbol]; | 163 "foo", 'blåbærgrød', 'Îñţérñåţîöñåļîžåţîờñ', "\u{1D11E}", #symbol]; |
| 181 valueObjects.forEach((v) => checkInstance(reflect(v), 'value object')); | 164 valueObjects.forEach((v) => checkInstance(reflect(v), 'value object')); |
| 182 | 165 |
| 183 uncaughtErrorHandler(self, parent, zone, error, stack) {}; | 166 uncaughtErrorHandler(self, parent, zone, error, stack) {}; |
| 184 var zoneSpec = | 167 var zoneSpec = |
| 185 new ZoneSpecification(handleUncaughtError: uncaughtErrorHandler); | 168 new ZoneSpecification(handleUncaughtError: uncaughtErrorHandler); |
| 186 testZone = Zone.current.fork(specification: zoneSpec); | 169 testZone = Zone.current.fork(specification: zoneSpec); |
| 187 testZone.createTimer(Duration.ZERO, doOneTask); | 170 testZone.createTimer(Duration.ZERO, doOneTask); |
| 188 } | 171 } |
| OLD | NEW |