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

Side by Side Diff: client/tests/client/dom/DOMIsolatesTest.dart

Issue 10037027: unittest step2: bye bye to multiple entrypoints for unittest (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 8 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_dom.dart'); 2 #import('../../../../lib/unittest/unittest.dart');
3 #import('../../../../lib/unittest/dom_config.dart');
3 #import('dart:dom'); 4 #import('dart:dom');
4 #import('dart:isolate'); 5 #import('dart:isolate');
5 6
6 isolateMain(port) { 7 isolateMain(port) {
7 port.receive((msg, replyTo) { 8 port.receive((msg, replyTo) {
8 if (msg != 'check') { 9 if (msg != 'check') {
9 replyTo.send('wrong msg: $msg'); 10 replyTo.send('wrong msg: $msg');
10 } 11 }
11 replyTo.send(window.location.toString()); 12 replyTo.send(window.location.toString());
12 port.close(); 13 port.close();
13 }); 14 });
14 } 15 }
15 16
16 isolateMainTrampoline(port) { 17 isolateMainTrampoline(port) {
17 final childPortFuture = spawnDomIsolate(window, 'isolateMain'); 18 final childPortFuture = spawnDomIsolate(window, 'isolateMain');
18 port.receive((msg, parentPort) { 19 port.receive((msg, parentPort) {
19 childPortFuture.then((childPort) { 20 childPortFuture.then((childPort) {
20 childPort.call(msg).then((response) { 21 childPort.call(msg).then((response) {
21 parentPort.send(response); 22 parentPort.send(response);
22 port.close(); 23 port.close();
23 }); 24 });
24 }); 25 });
25 }); 26 });
26 } 27 }
27 28
28 main() { 29 main() {
29 forLayoutTests(); 30 useDomConfiguration();
30 31
31 final iframe = document.createElement('iframe'); 32 final iframe = document.createElement('iframe');
32 document.body.appendChild(iframe); 33 document.body.appendChild(iframe);
33 34
34 asyncTest('Simple DOM isolate test', 1, () { 35 asyncTest('Simple DOM isolate test', 1, () {
35 spawnDomIsolate(iframe.contentWindow, 'isolateMain').then((sendPort) { 36 spawnDomIsolate(iframe.contentWindow, 'isolateMain').then((sendPort) {
36 sendPort.call('check').then((msg) { 37 sendPort.call('check').then((msg) {
37 Expect.equals('about:blank', msg); 38 Expect.equals('about:blank', msg);
38 callbackDone(); 39 callbackDone();
39 }); 40 });
(...skipping 10 matching lines...) Expand all
50 }); 51 });
51 52
52 test('Null as target window', () { 53 test('Null as target window', () {
53 expectThrow(() => spawnDomIsolate(null, 'isolateMain')); 54 expectThrow(() => spawnDomIsolate(null, 'isolateMain'));
54 }); 55 });
55 56
56 test('Not window as target window', () { 57 test('Not window as target window', () {
57 expectThrow(() => spawnDomIsolate(document, 'isolateMain')); 58 expectThrow(() => spawnDomIsolate(document, 'isolateMain'));
58 }); 59 });
59 } 60 }
OLDNEW
« no previous file with comments | « client/tests/client/dom/DOMConstructorsTest.dart ('k') | client/tests/client/dom/DOMParserTest.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698