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

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

Issue 11275054: Modified unittest to use new argument syntax. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 1 month 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
1 #library('WindowOpenTest'); 1 #library('WindowOpenTest');
2 #import('../../pkg/unittest/unittest.dart'); 2 #import('../../pkg/unittest/unittest.dart');
3 #import('../../pkg/unittest/html_config.dart'); 3 #import('../../pkg/unittest/html_config.dart');
4 #import('dart:html'); 4 #import('dart:html');
5 5
6 main() { 6 main() {
7 useHtmlConfiguration(); 7 useHtmlConfiguration();
8 evaluateJavaScript(code) { 8 evaluateJavaScript(code) {
9 final scriptTag = new Element.tag('script'); 9 final scriptTag = new Element.tag('script');
10 scriptTag.innerHTML = code; 10 scriptTag.innerHTML = code;
11 document.body.nodes.add(scriptTag); 11 document.body.nodes.add(scriptTag);
12 } 12 }
13 evaluateJavaScript('(testRunner || layoutTestController).setCanOpenWindows()') ; 13 // evaluateJavaScript('(window.testRunner || window.layoutTestController) ? (wi ndow.testRunner || window.layoutTestController).setCanOpenWindows() : null');
Siggi Cherem (dart-lang) 2012/10/26 00:44:51 strange - uncomment?
14 14
gram 2012/10/26 00:50:34 Good catch - this file should not be in the CL. It
15 test('TwoArgumentVersion', () { 15 test('TwoArgumentVersion', () {
16 Window win = window.open('../resources/pong.html', 'testWindow'); 16 Window win = window.open('../resources/pong.html', 'testWindow');
17 closeWindow(win); 17 closeWindow(win);
18 }); 18 });
19 test('ThreeArgumentVersion', () { 19 test('ThreeArgumentVersion', () {
20 Window win = window.open("resources/pong.html", "testWindow", "scrollbars=ye s,width=75,height=100"); 20 Window win = window.open("resources/pong.html", "testWindow", "scrollbars=ye s,width=75,height=100");
21 closeWindow(win); 21 closeWindow(win);
22 }); 22 });
23 } 23 }
24 24
25 closeWindow(win) { 25 closeWindow(win) {
26 win.close(); 26 win.close();
27 doneHandler() { 27 doneHandler() {
28 if (!win.closed) { 28 if (!win.closed) {
29 window.setTimeout(expectAsync0(doneHandler), 1); 29 window.setTimeout(expectAsync0(doneHandler), 1);
30 } 30 }
31 } 31 }
32 window.setTimeout(expectAsync0(doneHandler), 1); 32 window.setTimeout(expectAsync0(doneHandler), 1);
33 } 33 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698