Chromium Code Reviews| OLD | NEW |
|---|---|
| (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 } | |
| OLD | NEW |