mirror of
https://github.com/dart-lang/sdk
synced 2024-09-20 08:38:17 +00:00
2dcd56ef43
There are far too many files here to review everyone carefully. Spot checking most of the diffs look good as test code is generally written with less care than application code so lots of ugly formatting get through. If people notice files where the automated formatting bothers them feel free to comment indicating file names and I'll move spaces within comments to make the formatting cleaner and use comments to force block formatting as I have done for other case where formatting looked bad. BUG= R=efortuna@google.com Review-Url: https://codereview.chromium.org/2771453003 .
49 lines
1.4 KiB
Dart
49 lines
1.4 KiB
Dart
library async_test;
|
|
|
|
import 'package:unittest/unittest.dart';
|
|
import 'package:unittest/html_config.dart';
|
|
|
|
import 'dart:async';
|
|
import 'dart:isolate';
|
|
import 'dart:html';
|
|
|
|
import 'async_oneshot.dart' as oneshot_test show main;
|
|
import 'async_periodictimer.dart' as periodictimer_test show main;
|
|
import 'async_cancellingisolate.dart' as cancelling_test show main;
|
|
|
|
oneshot(message) => oneshot_test.main(message.first, message.last);
|
|
periodicTimerIsolate(message) =>
|
|
periodictimer_test.main(message.first, message.last);
|
|
cancellingIsolate(message) => cancelling_test.main(message.first, message.last);
|
|
|
|
main() {
|
|
useHtmlConfiguration();
|
|
|
|
test('one shot timer in pure isolate', () {
|
|
var response = new ReceivePort();
|
|
var remote = Isolate.spawn(oneshot, [
|
|
['START'],
|
|
response.sendPort
|
|
]);
|
|
expect(remote.then((_) => response.first), completion('DONE'));
|
|
});
|
|
|
|
test('periodic timer in pure isolate', () {
|
|
var response = new ReceivePort();
|
|
var remote = Isolate.spawn(periodicTimerIsolate, [
|
|
['START'],
|
|
response.sendPort
|
|
]);
|
|
expect(remote.then((_) => response.first), completion('DONE'));
|
|
});
|
|
|
|
test('cancellation in pure isolate', () {
|
|
var response = new ReceivePort();
|
|
var remote = Isolate.spawn(cancellingIsolate, [
|
|
['START'],
|
|
response.sendPort
|
|
]);
|
|
expect(remote.then((_) => response.first), completion('DONE'));
|
|
});
|
|
}
|