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

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

Issue 10696092: Initial tests for JS interop (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 5 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 #library('JsInterop1Test');
kasperl 2012/07/04 05:13:00 Add copyright notice.
vsm 2012/07/04 07:43:09 Done.
2 #import('../../lib/unittest/unittest.dart');
3 #import('../../lib/unittest/html_config.dart');
4 #import('dart:html');
5 #import('dart:json');
6
7 injectSource(code) {
8 final script = new ScriptElement();
9 script.type = 'text/javascript';
10 script.innerHTML = code;
11 document.body.nodes.add(script);
12 }
13
14 main() {
15 useHtmlConfiguration();
16 var callback;
17
18 test('jsPostMessage', () {
19 callback = expectAsync1((e) {
kasperl 2012/07/04 05:13:00 Too much indentation: Use 2 spaces here.
vsm 2012/07/04 07:43:09 Done.
20 Expect.equals('hello', e.data);
kasperl 2012/07/04 05:13:00 Too much indentation. Use 2 spaces here.
vsm 2012/07/04 07:43:09 Done.
21 window.on.message.remove(callback);
22 });
kasperl 2012/07/04 05:13:00 Don't indent this.
vsm 2012/07/04 07:43:09 Done.
23 window.on.message.add(callback);
24 injectSource("window.postMessage('hello', '*');");
25 });
26 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698