| Index: tests/html/dom_isolates_test.dart
|
| diff --git a/tests/html/dom_isolates_test.dart b/tests/html/dom_isolates_test.dart
|
| index ed36360ef066c0b5cce7d4adda7953ebfc305f9b..7ce1386c25aa2ef3d63fe9509a02c81375602c4b 100644
|
| --- a/tests/html/dom_isolates_test.dart
|
| +++ b/tests/html/dom_isolates_test.dart
|
| @@ -8,7 +8,7 @@ import '../../pkg/unittest/lib/html_config.dart';
|
| import 'dart:html';
|
| import 'dart:isolate';
|
|
|
| -isolateMain() {
|
| +childDomIsolate() {
|
| port.receive((msg, replyTo) {
|
| if (msg != 'check') {
|
| replyTo.send('wrong msg: $msg');
|
| @@ -18,8 +18,8 @@ isolateMain() {
|
| });
|
| }
|
|
|
| -isolateMainTrampoline() {
|
| - final future = spawnDomFunction(isolateMain);
|
| +trampolineIsolate() {
|
| + final future = spawnDomFunction(childDomIsolate);
|
| port.receive((msg, parentPort) {
|
| future.then((childPort) {
|
| childPort.call(msg).then((response) {
|
| @@ -30,29 +30,28 @@ isolateMainTrampoline() {
|
| });
|
| }
|
|
|
| -dummy() => print("Bad invocation of top-level function");
|
| +dummy() => print('Bad invocation of top-level function');
|
|
|
| main() {
|
| useHtmlConfiguration();
|
|
|
| test('Simple DOM isolate test', () {
|
| - spawnDomFunction(isolateMain).then((sendPort) {
|
| - sendPort.call('check').then(
|
| - expectAsync1((msg) {
|
| - expect(msg, equals('${window.location}'));
|
| - }));
|
| + spawnDomFunction(childDomIsolate).then((sendPort) {
|
| + expect(sendPort.call('check'), completion('${window.location}'));
|
| });
|
| });
|
|
|
| test('Nested DOM isolates test', () {
|
| - spawnDomFunction(isolateMainTrampoline).then((sendPort) {
|
| - sendPort.call('check').then(
|
| - expectAsync1((msg) {
|
| - expect(msg, equals('${window.location}'));
|
| - }));
|
| + spawnDomFunction(trampolineIsolate).then((sendPort) {
|
| + expect(sendPort.call('check'), completion('${window.location}'));
|
| });
|
| });
|
|
|
| + test('Spawn DOM isolate from pure', () {
|
| + expect(spawnFunction(trampolineIsolate).call('check'),
|
| + completion('${window.location}'));
|
| + });
|
| +
|
| test('Not function', () {
|
| expect(() => spawnDomFunction(42), throws);
|
| });
|
| @@ -64,7 +63,7 @@ main() {
|
|
|
| test('Masked local function', () {
|
| var local = 42;
|
| - dummy() => print("Bad invocation of local function: $local");
|
| + dummy() => print('Bad invocation of local function: $local');
|
| expect(() => spawnDomFunction(dummy), throws);
|
| });
|
| }
|
|
|