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

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

Issue 1154673004: Add "checked" parameter to Isolate.spawnUri. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Skip test for everything but VM for now. Created 5 years, 6 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
« no previous file with comments | « sdk/lib/isolate/isolate.dart ('k') | tests/isolate/isolate.status » ('j') | 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) 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
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 import "package:async_helper/async_helper.dart";
9
10 void main([args, message]) {
11 if (message != null) return isolateMain(message);
12
13 bool isChecked = false;
14 assert((isChecked = true));
15 if (isChecked) return; // Skip this test in checked mode.
16
17 var responses = {};
18 var port = new RawReceivePort();
19 port.handler = (pair) {
20 responses[pair[0]] = pair[1];
21 if (responses.length == 3) {
22 port.close();
23 Expect.isTrue(responses[true], "true @ $isChecked");
24 Expect.isTrue(responses[false], "false @ $isChecked");
25 Expect.isTrue(responses[null], "null @ $isChecked");
26 }
27 };
28 test(checked) {
29 Isolate.spawnUri(Uri.parse("checked_test.dart"), [],
30 [checked, isChecked, port.sendPort],
31 checked: checked);
32 }
33 test(true);
34 test(false);
35 test(null);
36 }
37
38
39 void isolateMain(args) {
40 var checkedFlag = args[0];
41 var parentIsChecked = args[1];
42 var responsePort = args[2];
43 bool isChecked = false;
44 assert((isChecked = true));
45 bool expected = checkedFlag;
46 if (checkedFlag == null) expected = parentIsChecked;
47 responsePort.send([checkedFlag, expected == isChecked]);
48 }
OLDNEW
« no previous file with comments | « sdk/lib/isolate/isolate.dart ('k') | tests/isolate/isolate.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698