OLD | NEW |
1 #library('DOMIsolatesTest'); | 1 #library('DOMIsolatesTest'); |
2 #import('../../../testing/unittest/unittest.dart'); | 2 #import('../../../testing/unittest/unittest_dom.dart'); |
3 #import('dart:dom'); | 3 #import('dart:dom'); |
4 #import('dart:isolate'); | 4 #import('dart:isolate'); |
5 | 5 |
6 isolateMain(port) { | 6 isolateMain(port) { |
7 port.receive((msg, replyTo) { | 7 port.receive((msg, replyTo) { |
8 if (msg != 'check') { | 8 if (msg != 'check') { |
9 replyTo.send('wrong msg: $msg'); | 9 replyTo.send('wrong msg: $msg'); |
10 } | 10 } |
11 replyTo.send(window.location.toString()); | 11 replyTo.send(window.location.toString()); |
12 port.close(); | 12 port.close(); |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 }); | 50 }); |
51 | 51 |
52 test('Null as target window', () { | 52 test('Null as target window', () { |
53 expectThrow(() => spawnDomIsolate(null, 'isolateMain')); | 53 expectThrow(() => spawnDomIsolate(null, 'isolateMain')); |
54 }); | 54 }); |
55 | 55 |
56 test('Not window as target window', () { | 56 test('Not window as target window', () { |
57 expectThrow(() => spawnDomIsolate(document, 'isolateMain')); | 57 expectThrow(() => spawnDomIsolate(document, 'isolateMain')); |
58 }); | 58 }); |
59 } | 59 } |
OLD | NEW |