OLD | NEW |
| (Empty) |
1 #import('../../../../../dart/client/testing/unittest/unittest.dart'); | |
2 #import('dart:dom'); | |
3 | |
4 main() { | |
5 // FIXME: when JS DOM has proper layoutTestController support, should go away. | |
6 window.setTimeout(() { | |
7 evaluateJavaScript(code) { | |
8 final scriptTag = document.createElement('script'); | |
9 scriptTag.innerHTML = code; | |
10 document.body.appendChild(scriptTag); | |
11 } | |
12 evaluateJavaScript('layoutTestController.setCanOpenWindows()'); | |
13 }, 0); | |
14 | |
15 forLayoutTests(); | |
16 asyncTest('TwoArgumentVersion', 1, () { | |
17 Window win = window.open('../resources/pong.html', 'testWindow'); | |
18 closeWindow(win); | |
19 }); | |
20 asyncTest('ThreeArgumentVersion', 1, () { | |
21 Window win = window.open("resources/pong.html", "testWindow", "scrollbars=ye
s,width=75,height=100"); | |
22 closeWindow(win); | |
23 }); | |
24 } | |
25 | |
26 closeWindow(win) { | |
27 win.close(); | |
28 doneHandler() { | |
29 window.setTimeout(win.closed ? callbackDone : doneHandler, 1); | |
30 } | |
31 window.setTimeout(doneHandler, 1); | |
32 } | |
OLD | NEW |