Files
sdk/tests/html/window_open_test.dart
T
gram@google.com 9248731b39 Change asyncTest/callbackDone style tests to use the new expectAsync/
guardAsync form, and fix a couple of issues in the unit test library
related to these.
Note: this CL covers the changes in the tests directory. There are a few
changes in utils and samples; these will de done in a separate CL.
Review URL: https://chromiumcodereview.appspot.com//10412015

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7877 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-22 20:37:25 +00:00

34 lines
897 B
Dart

#library('WindowOpenTest');
#import('../../lib/unittest/unittest.dart');
#import('../../lib/unittest/html_config.dart');
#import('dart:html');
main() {
evaluateJavaScript(code) {
final scriptTag = new Element.tag('script');
scriptTag.innerHTML = code;
document.body.nodes.add(scriptTag);
}
evaluateJavaScript('layoutTestController.setCanOpenWindows()');
useHtmlConfiguration();
test('TwoArgumentVersion', () {
Window win = window.open('../resources/pong.html', 'testWindow');
closeWindow(win);
});
test('ThreeArgumentVersion', () {
Window win = window.open("resources/pong.html", "testWindow", "scrollbars=yes,width=75,height=100");
closeWindow(win);
});
}
closeWindow(win) {
win.close();
doneHandler() {
if (!win.closed) {
window.setTimeout(expectAsync0(doneHandler), 1);
}
}
window.setTimeout(expectAsync0(doneHandler), 1);
}