@@ -30,23 +30,26 @@ public class ElementClosesItselfTest extends WebDriverTestCase {
3030
3131 private void test (final String tagName ) throws Exception {
3232 if ("basefont" .equals (tagName ) || "isindex" .equals (tagName )) {
33- loadPageWithAlerts2 (headElementClosesItself (tagName ));
33+ loadPage2 (headElementClosesItself (tagName ));
34+ verifyWindowName2 (getWebDriver (), getExpectedAlerts ());
3435 return ;
3536 }
3637
3738 if ("title" .equals (tagName )) {
3839 // title is a bit special, we have to provide at least
3940 // one closing tab otherwise title spans to the end of the file
40- loadPageWithAlerts2 (DOCTYPE_HTML + "<html><head>\n "
41+ loadPage2 (DOCTYPE_HTML + "<html><head>\n "
4142 + "<script>\n "
43+ + LOG_WINDOW_NAME_FUNCTION
4244 + "function test() {\n "
4345 + " var e = document.getElementById('outer');\n "
44- + " alert (e == null ? e : e.children.length);\n "
46+ + " log (e == null ? e : e.children.length);\n "
4547 + "}\n "
4648 + "</script>\n "
4749 + "<title id='outer'><title></title>\n "
4850 + "</head><body onload='test()'>\n "
4951 + "</body></html>" );
52+ verifyWindowName2 (getWebDriver (), getExpectedAlerts ());
5053 return ;
5154 }
5255
@@ -84,18 +87,20 @@ private void test(final String tagName) throws Exception {
8487 }
8588
8689 if ("frameset" .equals (tagName )) {
87- loadPageWithAlerts2 (DOCTYPE_HTML
90+ loadPage2 (DOCTYPE_HTML
8891 + "<html><head>\n "
8992 + "<script>\n "
93+ + LOG_WINDOW_NAME_FUNCTION
9094 + "function test() {\n "
9195 + " var e = document.getElementById('outer');\n "
92- + " alert (e == null ? e : e.children.length);\n "
96+ + " log (e == null ? e : e.children.length);\n "
9397 + "}\n "
9498 + "</script>\n "
9599 + "</head>\n "
96100 + "<frameset onload='test()' id='outer'>\n "
97101 + "<frameset>\n "
98102 + "</frameset></html>" );
103+ verifyWindowName2 (getWebDriver (), getExpectedAlerts ());
99104 return ;
100105 }
101106
@@ -120,9 +125,10 @@ private static String headElementClosesItself(final String tagName) {
120125 + "<html><head>\n "
121126 + "<" + tagName + " id='outer'><" + tagName + ">\n "
122127 + "<script>\n "
128+ + LOG_WINDOW_NAME_FUNCTION
123129 + "function test() {\n "
124130 + " var e = document.getElementById('outer');\n "
125- + " alert (e == null ? e : e.children.length);\n "
131+ + " log (e == null ? e : e.children.length);\n "
126132 + "}\n "
127133 + "</script>\n "
128134 + "</head><body onload='test()'>\n "
0 commit comments