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 will various basic values (nulls, ints, etc). This may result in | 6 // invoke them will 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 run blocking io calls. | 23 // Don't run blocking io calls. |
24 new RegExp(r".*Sync$"), | 24 new RegExp(r".*Sync$"), |
25 | 25 |
26 // These prevent the test from exiting. | 26 // These prevent the test from exiting. |
27 'dart.async._scheduleAsyncCallback', | 27 'dart.async._scheduleAsyncCallback', |
28 'dart.async._setTimerFactoryClosure', | 28 'dart.async._setTimerFactoryClosure', |
29 'dart.isolate._startMainIsolate', | 29 'dart.isolate._startMainIsolate', |
30 'dart.isolate._startIsolate', | 30 'dart.isolate._startIsolate', |
Ivan Posva
2014/12/02 07:40:16
Are these visible through mirrors? Probably should
rmacnak
2014/12/03 21:59:23
Hiding many of these in another CL.
| |
31 'dart.io.sleep', | 31 'dart.io.sleep', |
32 'dart.io.HttpServer.HttpServer.listenOn', | 32 'dart.io.HttpServer.HttpServer.listenOn', |
33 new RegExp(r'dart.io.*'), /// smi: ok | 33 new RegExp(r'dart.io.*'), /// smi: ok |
34 | 34 |
35 // Runtime exceptions we can't catch because they occur too early in event | 35 // Runtime exceptions we can't catch because they occur too early in event |
36 // dispatch to be caught in a zone. | 36 // dispatch to be caught in a zone. |
37 'dart.isolate._isolateScheduleImmediate', | 37 'dart.isolate._isolateScheduleImmediate', |
38 'dart.io._Timer._createTimer', /// smi: ok | 38 'dart.io._Timer._createTimer', /// smi: ok |
39 'dart.async.runZoned', /// string: ok | 39 'dart.async.runZoned', /// string: ok |
40 'dart.async._AsyncRun._scheduleImmediate', | |
41 'dart.async._ScheduleImmediate._closure', | |
40 'dart.async._asyncRunCallback', | 42 'dart.async._asyncRunCallback', |
43 'dart.async._rootHandleUncaughtError', | |
44 'dart.async._schedulePriorityAsyncCallback', | |
45 'dart.async._setScheduleImmediateClosure', | |
41 | 46 |
42 // These either cause the VM to segfault or throw uncatchable API errors. | 47 // These either cause the VM to segfault or throw uncatchable API errors. |
43 // TODO(15274): Fix them and remove from blacklist. | 48 // TODO(15274): Fix them and remove from blacklist. |
44 'dart.io._IOService.dispatch', | 49 'dart.io._IOService.dispatch', |
45 new RegExp(r'.*_RandomAccessFile.*'), | 50 new RegExp(r'.*_RandomAccessFile.*'), |
46 'dart.io._StdIOUtils._socketType', | 51 'dart.io._StdIOUtils._socketType', |
47 'dart.io._StdIOUtils._getStdioOutputStream', | 52 'dart.io._StdIOUtils._getStdioOutputStream', |
48 'dart.io._Filter.newZLibInflateFilter', | 53 'dart.io._Filter.newZLibInflateFilter', |
49 'dart.io._Filter.newZLibDeflateFilter', | 54 'dart.io._Filter.newZLibDeflateFilter', |
50 'dart.io._FileSystemWatcher._listenOnSocket', | 55 'dart.io._FileSystemWatcher._listenOnSocket', |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
177 0, 0xEFFFFFF, 0xFFFFFFFF, 0xFFFFFFFFFFFFFFFF, | 182 0, 0xEFFFFFF, 0xFFFFFFFF, 0xFFFFFFFFFFFFFFFF, |
178 "foo", 'blåbærgrød', 'Îñţérñåţîöñåļîžåţîờñ', "𝄞", #symbol]; | 183 "foo", 'blåbærgrød', 'Îñţérñåţîöñåļîžåţîờñ', "𝄞", #symbol]; |
179 valueObjects.forEach((v) => checkInstance(reflect(v), 'value object')); | 184 valueObjects.forEach((v) => checkInstance(reflect(v), 'value object')); |
180 | 185 |
181 uncaughtErrorHandler(self, parent, zone, error, stack) {}; | 186 uncaughtErrorHandler(self, parent, zone, error, stack) {}; |
182 var zoneSpec = | 187 var zoneSpec = |
183 new ZoneSpecification(handleUncaughtError: uncaughtErrorHandler); | 188 new ZoneSpecification(handleUncaughtError: uncaughtErrorHandler); |
184 testZone = Zone.current.fork(specification: zoneSpec); | 189 testZone = Zone.current.fork(specification: zoneSpec); |
185 testZone.createTimer(Duration.ZERO, doOneTask); | 190 testZone.createTimer(Duration.ZERO, doOneTask); |
186 } | 191 } |
OLD | NEW |