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

Side by Side Diff: tests/dom/dom_isolates_test.dart

Issue 10412015: aChange all asyncTest/callbackDone style tests to use the new expectAsync/ (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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
OLDNEW
1 #library('DOMIsolatesTest'); 1 #library('DOMIsolatesTest');
2 #import('../../lib/unittest/unittest.dart'); 2 #import('../../lib/unittest/unittest.dart');
3 #import('../../lib/unittest/dom_config.dart'); 3 #import('../../lib/unittest/dom_config.dart');
4 #import('dart:dom_deprecated'); 4 #import('dart:dom_deprecated');
5 #import('dart:isolate'); 5 #import('dart:isolate');
6 6
7 isolateMain(port) { 7 isolateMain(port) {
8 port.receive((msg, replyTo) { 8 port.receive((msg, replyTo) {
9 if (msg != 'check') { 9 if (msg != 'check') {
10 replyTo.send('wrong msg: $msg'); 10 replyTo.send('wrong msg: $msg');
(...skipping 14 matching lines...) Expand all
25 }); 25 });
26 }); 26 });
27 } 27 }
28 28
29 main() { 29 main() {
30 useDomConfiguration(); 30 useDomConfiguration();
31 31
32 final iframe = document.createElement('iframe'); 32 final iframe = document.createElement('iframe');
33 document.body.appendChild(iframe); 33 document.body.appendChild(iframe);
34 34
35 asyncTest('Simple DOM isolate test', 1, () { 35 test('Simple DOM isolate test', () {
36 spawnDomIsolate(iframe.contentWindow, 'isolateMain').then((sendPort) { 36 spawnDomIsolate(iframe.contentWindow, 'isolateMain').
37 sendPort.call('check').then((msg) { 37 then(expectAsync1((sendPort) {
38 Expect.equals('about:blank', msg); 38 sendPort.call('check').then(expectAsync1((msg) {
39 callbackDone(); 39 Expect.equals('about:blank', msg);
40 }); 40 }));
41 }); 41 }));
42 }); 42 });
43 43
44 asyncTest('Nested DOM isolates test', 1, () { 44 test('Nested DOM isolates test', () {
45 spawnDomIsolate(iframe.contentWindow, 'isolateMainTrampoline').then((sendPor t) { 45 spawnDomIsolate(iframe.contentWindow, 'isolateMainTrampoline').
46 sendPort.call('check').then((msg) { 46 then(expectAsync1((sendPort) {
47 Expect.equals('about:blank', msg); 47 sendPort.call('check').then(expectAsync1((msg) {
48 callbackDone(); 48 Expect.equals('about:blank', msg);
49 }); 49 }));
50 }); 50 }));
51 }); 51 });
52 52
53 test('Null as target window', () { 53 test('Null as target window', () {
54 expectThrow(() => spawnDomIsolate(null, 'isolateMain')); 54 expectThrow(() => spawnDomIsolate(null, 'isolateMain'));
55 }); 55 });
56 56
57 test('Not window as target window', () { 57 test('Not window as target window', () {
58 expectThrow(() => spawnDomIsolate(document, 'isolateMain')); 58 expectThrow(() => spawnDomIsolate(document, 'isolateMain'));
59 }); 59 });
60 } 60 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698