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

Side by Side Diff: LayoutTests/dart/dom/DOMIsolates.dart

Issue 9188009: Things to unfork. (Closed) Base URL: svn://svn.chromium.org/multivm/trunk/webkit
Patch Set: Created 8 years, 11 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
(Empty)
1 #import('../../../../../dart/client/testing/unittest/unittest.dart');
2 #import('dart:dom');
3
4 isolateMain(port) {
5 port.receive((msg, replyTo) {
6 if (msg != 'check') {
7 replyTo.send('wrong msg: $msg');
8 }
9 replyTo.send(window.location.toString());
10 port.close();
11 });
12 }
13
14 isolateMainTrampoline(port) {
15 final childPortFuture = spawnDomIsolate(window, 'isolateMain');
16 port.receive((msg, parentPort) {
17 childPortFuture.then((childPort) {
18 childPort.call(msg).receive((response, _) {
19 parentPort.send(response);
20 port.close();
21 });
22 });
23 });
24 }
25
26 main() {
27 forLayoutTests();
28
29 final iframe = document.createElement('iframe');
30 document.body.appendChild(iframe);
31
32 asyncTest('Simple DOM isolate test', 1, () {
33 spawnDomIsolate(iframe.contentWindow, 'isolateMain').then((sendPort) {
34 sendPort.call('check').receive((msg, replyTo) {
35 Expect.equals('about:blank', msg);
36 callbackDone();
37 });
38 });
39 });
40
41 asyncTest('Nested DOM isolates test', 1, () {
42 spawnDomIsolate(iframe.contentWindow, 'isolateMainTrampoline').then((sendPor t) {
43 sendPort.call('check').receive((msg, replyTo) {
44 Expect.equals('about:blank', msg);
45 callbackDone();
46 });
47 });
48 });
49
50 test('Null as target window', () {
51 expectThrow(() => spawnDomIsolate(null, 'isolateMain'));
52 });
53
54 test('Not window as target window', () {
55 expectThrow(() => spawnDomIsolate(document, 'isolateMain'));
56 });
57 }
OLDNEW
« no previous file with comments | « LayoutTests/dart/dom/DOMConstructors-expected.txt ('k') | LayoutTests/dart/dom/DOMIsolates.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698