Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 /* | |
| 2 * Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | |
| 3 * for details. All rights reserved. Use of this source code is governed by a | |
| 4 * BSD-style license that can be found in the LICENSE file. | |
| 5 */ | |
|
Dmitry Stefantsov
2017/08/24 09:41:13
Please, write a short description of the test here
sjindel
2017/08/24 11:11:43
Done.
Dmitry Stefantsov
2017/08/24 11:49:57
Thanks! It would be nice to boil down this test c
| |
| 6 class X {} | |
| 7 | |
| 8 typedef dynamic fn(dynamic x); | |
| 9 typedef dynamic fn2(dynamic x, dynamic y); | |
| 10 | |
| 11 void startIsolateMock( | |
| 12 dynamic parentPort, | |
| 13 dynamic entryPoint, | |
| 14 dynamic args, | |
| 15 dynamic message, | |
| 16 dynamic isSpawnUri, | |
| 17 dynamic controlPort, | |
| 18 List<dynamic> capabilities) { | |
| 19 if (controlPort != null) { | |
| 20 controlPort.handler = (dynamic _) {}; | |
| 21 } | |
| 22 if (parentPort != null) { | |
| 23 dynamic readyMessage = new List<dynamic>(2); | |
| 24 readyMessage[0] = controlPort.sendPort; | |
| 25 readyMessage[1] = capabilities; | |
| 26 capabilities = null; | |
| 27 parentPort.send(readyMessage); | |
| 28 } | |
| 29 assert(capabilities == null); | |
| 30 dynamic port = "abc"; | |
| 31 port.handler = (dynamic _) { | |
| 32 port.close(); | |
| 33 if (isSpawnUri) { | |
| 34 if (entryPoint is fn2) { | |
| 35 entryPoint.call(args, message); | |
| 36 } else if (entryPoint is fn) { | |
| 37 entryPoint.call(args); | |
| 38 } else { | |
| 39 entryPoint.call(); | |
| 40 } | |
| 41 } else { | |
| 42 entryPoint.call(message); | |
| 43 } | |
| 44 }; | |
| 45 port.sendPort.send(null); | |
| 46 } | |
| 47 | |
| 48 main() {} | |
|
Dmitry Stefantsov
2017/08/24 09:41:13
Also, a comment describing why [main] is empty wou
sjindel
2017/08/24 11:11:43
Done.
| |
| OLD | NEW |