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

Side by Side Diff: tests/language/deferred_in_isolate_test.dart

Issue 1133983002: Move isolate tests to lib/isolate. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix merge Created 5 years, 7 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/language/deferred_in_isolate_lib.dart ('k') | tests/language/enum_const_test.dart » ('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 // Test that deferred libraries are supported from isolates other than the root
6 // isolate.
7
8 import 'dart:isolate';
9
10 main() {
11 try {
12 var receivePort = new RawReceivePort();
13 var expectedMsg = "Deferred Loaded.";
14
15 receivePort.handler = (msg) {
16 if (msg != expectedMsg) {
17 print("Test failed.");
18 throw msg; // Fail the test if the message is not expected.
19 }
20 print('Test done.');
21 receivePort.close();
22 };
23
24 var stopwatch = new Stopwatch()..start();
25 Isolate.spawnUri(new Uri(path: 'deferred_in_isolate_app.dart'),
26 [expectedMsg],
27 [receivePort.sendPort]).then((isolate) {
28 print('Isolate spawn: ${stopwatch.elapsedMilliseconds}ms');
29 }).catchError((error) {
30 print(error);
31 });
32 } catch (exception, stackTrace) {
33 print('Test failed.');
34 print(exception);
35 print(stackTrace);
36 rethrow;
37 }
38 }
OLDNEW
« no previous file with comments | « tests/language/deferred_in_isolate_lib.dart ('k') | tests/language/enum_const_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698