Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(13)

Side by Side Diff: tests/isolate/issue_21398_parent_isolate2_test.dart

Issue 926073002: Fix crash that happens when we send an object whose type is in a defer (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tests/isolate/deferred_loaded_lib.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
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.
4
5 import 'dart:isolate';
6 import 'dart:async';
7 import "package:expect/expect.dart";
8
9 import "deferred_loaded_lib.dart" deferred as lib;
10
11 // In this test case we send an object created from a deferred library
12 // that is loaded in the child isolate but not the parent isolate. The
13 // parent isolate does not know about the type of this object and throws
14 // an unhandled exception.
15 funcChild(args) {
16 var replyPort = args[0];
17 // Deferred load a library, create an object from that library and send
18 // it over to the parent isolate which has not yet loaded that library.
19 lib.loadLibrary().then((_) {
20 replyPort.send(new lib.FromChildIsolate());
21 });
22 }
23
24 void helperFunction() {
25 var receivePort = new ReceivePort();
26
27 // Spawn an isolate using spawnFunction.
28 Isolate.spawn(funcChild, [receivePort.sendPort]).then(
29 (isolate) {
30 receivePort.listen(
31 (msg) {
32 // We don't expect to receive any valid messages.
33 Expect.fail("We don't expect to receive any valid messages");
34 receivePort.close();
35 },
36 onError: (e) {
37 // We don't expect to receive any error messages, per spec listen
38 // does not receive an error object.
39 Expect.fail("We don't expect to receive any error messages");
40 receivePort.close();
41 }
42 );
43 }
44 );
45 }
46
47 main() {
48 helperFunction(); /// 01: runtime error
ahe 2017/04/06 15:38:18 Why is this a multi-test?
siva 2017/04/06 18:15:42 It doesn't have to be, I think I did this way so i
ahe 2017/04/07 06:14:17 Which runtime error is expected, the one one line
49 }
OLDNEW
« no previous file with comments | « tests/isolate/deferred_loaded_lib.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698