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

Side by Side Diff: dart/tests/html/worker_api_test.dart

Issue 14762008: Use "self" not "window" for Worker API. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 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
(Empty)
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.
4
5 import 'dart:html';
6 import 'dart:isolate';
7
8 import 'package:unittest/unittest.dart';
9 import 'package:unittest/html_config.dart';
10
11 worker() {
12 port.receive((String uri, SendPort replyTo) {
13 try {
14 var url = Url.createObjectUrl(new Blob([''], 'application/javascript'));
15 Url.revokeObjectUrl(url);
16 replyTo.send('Hello from Worker');
17 } catch (e) {
18 replyTo.send('Error: $e');
19 }
20 port.close();
21 });
22 }
23
24 main() {
25 useHtmlConfiguration();
26
27 test('stress test', () {
28 spawnFunction(worker).call('').then(
29 expectAsync1((reply) => expect(reply, equals('Hello from Worker'))));
30 });
31 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698