| 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; |
| 11 | 11 |
| 12 import 'dart:mirrors'; | 12 import 'dart:mirrors'; |
| 13 import 'dart:async'; | 13 import 'dart:async'; |
| 14 | 14 |
| 15 // Methods to be skipped, by qualified name. | 15 // Methods to be skipped, by qualified name. |
| 16 var blacklist = [ | 16 var blacklist = [ |
| 17 // Don't recurse on this test. | 17 // Don't recurse on this test. |
| 18 'test.invoke_natives', | 18 'test.invoke_natives', |
| 19 | 19 |
| 20 // Don't exit the test pre-maturely. | 20 // Don't exit the test pre-maturely. |
| 21 'dart.io.exit', | 21 'dart.io.exit', |
| 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 kill random other processes. |
| 27 'dart.io.Process.killPid', |
| 28 |
| 26 // Don't run blocking io calls. | 29 // Don't run blocking io calls. |
| 27 new RegExp(r".*Sync$"), | 30 new RegExp(r".*Sync$"), |
| 28 | 31 |
| 29 // These prevent the test from exiting. | 32 // These prevent the test from exiting. |
| 30 'dart.io.sleep', | 33 'dart.io.sleep', |
| 31 'dart.io.HttpServer.HttpServer.listenOn', | 34 'dart.io.HttpServer.HttpServer.listenOn', |
| 32 | 35 |
| 33 // 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. |
| 34 // TODO(15274): Fix them and remove from blacklist. | 37 // TODO(15274): Fix them and remove from blacklist. |
| 35 'dart.io.SystemEncoding.decode', // Windows only | 38 'dart.io.SystemEncoding.decode', // Windows only |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 0, 0xEFFFFFF, 0xFFFFFFFF, 0xFFFFFFFFFFFFFFFF, 3.14159, | 165 0, 0xEFFFFFF, 0xFFFFFFFF, 0xFFFFFFFFFFFFFFFF, 3.14159, |
| 163 "foo", 'blåbærgrød', 'Îñţérñåţîöñåļîžåţîờñ', "\u{1D11E}", #symbol]; | 166 "foo", 'blåbærgrød', 'Îñţérñåţîöñåļîžåţîờñ', "\u{1D11E}", #symbol]; |
| 164 valueObjects.forEach((v) => checkInstance(reflect(v), 'value object')); | 167 valueObjects.forEach((v) => checkInstance(reflect(v), 'value object')); |
| 165 | 168 |
| 166 uncaughtErrorHandler(self, parent, zone, error, stack) {}; | 169 uncaughtErrorHandler(self, parent, zone, error, stack) {}; |
| 167 var zoneSpec = | 170 var zoneSpec = |
| 168 new ZoneSpecification(handleUncaughtError: uncaughtErrorHandler); | 171 new ZoneSpecification(handleUncaughtError: uncaughtErrorHandler); |
| 169 testZone = Zone.current.fork(specification: zoneSpec); | 172 testZone = Zone.current.fork(specification: zoneSpec); |
| 170 testZone.createTimer(Duration.ZERO, doOneTask); | 173 testZone.createTimer(Duration.ZERO, doOneTask); |
| 171 } | 174 } |
| OLD | NEW |