d7057b2d8c
This CL is identical to 18555. The reason it will work now is the corresponding dartium change has been checked in. TBR-blois BUG= Review URL: https://codereview.chromium.org//12254046 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18562 260f80e4-7a28-3924-810f-c04153c831b5
35 lines
976 B
Dart
35 lines
976 B
Dart
library WindowOpenTest;
|
|
import '../../pkg/unittest/lib/unittest.dart';
|
|
import '../../pkg/unittest/lib/html_config.dart';
|
|
import 'dart:html';
|
|
import 'dart:async';
|
|
|
|
main() {
|
|
useHtmlConfiguration();
|
|
evaluateJavaScript(code) {
|
|
final scriptTag = new Element.tag('script');
|
|
scriptTag.innerHtml = code;
|
|
document.body.nodes.add(scriptTag);
|
|
}
|
|
evaluateJavaScript('(testRunner || layoutTestController).setCanOpenWindows()');
|
|
|
|
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) {
|
|
new Timer(const Duration(milliseconds: 1), expectAsync0(doneHandler));
|
|
}
|
|
}
|
|
new Timer(const Duration(milliseconds: 1), expectAsync0(doneHandler));
|
|
}
|