Skip to content

Commit

Permalink
test for the correct error
Browse files Browse the repository at this point in the history
  • Loading branch information
rbri committed Feb 7, 2025
1 parent 72599b0 commit 2e56a64
Show file tree
Hide file tree
Showing 19 changed files with 49 additions and 87 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,7 @@ public void scopeName2() throws Exception {
+ " x.tagUrn = 'http://www.meh.com/meh';\n"
+ " log(x.scopeName);\n"
+ " log(x.tagUrn);\n"
+ " } catch(e) {\n"
+ " log('error');\n"
+ " }\n"
+ " } catch(e) { logEx(e); }\n"
+ " }\n"
+ "</script>\n"
+ "</head>\n"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public void setAlign() throws Exception {
+ " function setAlign(elem, value) {\n"
+ " try {\n"
+ " elem.align = value;\n"
+ " } catch(e) { log('error'); }\n"
+ " } catch(e) { logEx(e); }\n"
+ " log(elem.align);\n"
+ " }\n"

Expand Down Expand Up @@ -157,7 +157,7 @@ public void setHeight() throws Exception {
+ " function setHeight(elem, value) {\n"
+ " try {\n"
+ " elem.height = value;\n"
+ " } catch(e) { log('error'); }\n"
+ " } catch(e) { logEx(e); }\n"
+ " log(elem.height);\n"
+ " }\n"

Expand Down Expand Up @@ -214,7 +214,7 @@ public void setWidth() throws Exception {
+ " function setWidth(elem, value) {\n"
+ " try {\n"
+ " elem.width = value;\n"
+ " } catch(e) { log('error'); }\n"
+ " } catch(e) { logEx(e); }\n"
+ " log(elem.width);\n"
+ " }\n"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public void setAlign() throws Exception {
+ " function setAlign(elem, value) {\n"
+ " try {\n"
+ " elem.align = value;\n"
+ " } catch(e) { log('error'); }\n"
+ " } catch(e) { logEx(e); }\n"
+ " log(elem.align);\n"
+ " }\n"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,7 @@ public void deny() throws Exception {
+ " function check() {\n"
+ " try {\n"
+ " log(document.getElementById(\"frame1\").contentDocument);\n"
+ " } catch(e) { log('error'); }\n"
+ " } catch(e) { logEx(e); }\n"
+ " }\n"
+ " </script>\n"
+ "</head>\n"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public void setAlign() throws Exception {
+ " function setAlign(elem, value) {\n"
+ " try {\n"
+ " elem.align = value;\n"
+ " } catch(e) { log('error'); }\n"
+ " } catch(e) { logEx(e); }\n"
+ " log(elem.align);\n"
+ " }\n"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public void setAlign() throws Exception {
+ " function setAlign(elem, value) {\n"
+ " try {\n"
+ " elem.align = value;\n"
+ " } catch(e) { log('error'); }\n"
+ " } catch(e) { logEx(e); }\n"
+ " log(elem.align);\n"
+ " }\n"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -851,7 +851,7 @@ public void setAlign() throws Exception {
+ " function setAlign(elem, value) {\n"
+ " try {\n"
+ " elem.align = value;\n"
+ " } catch(e) { log('error'); }\n"
+ " } catch(e) { logEx(e); }\n"
+ " log(elem.align);\n"
+ " }\n"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -314,9 +314,7 @@ public void width() throws Exception {
+ "function set(e, value) {\n"
+ " try {\n"
+ " e.width = value;\n"
+ " } catch(e) {\n"
+ " log('error');\n"
+ " }\n"
+ " } catch(e) { logEx(e); }\n"
+ "}\n"
+ "var i1 = document.getElementById('i1');\n"
+ "var i2 = document.getElementById('i2');\n"
Expand Down Expand Up @@ -368,9 +366,7 @@ public void height() throws Exception {
+ "function set(e, value) {\n"
+ " try {\n"
+ " e.height = value;\n"
+ " } catch(e) {\n"
+ " log('error');\n"
+ " }\n"
+ " } catch(e) { logEx(e); }\n"
+ "}\n"
+ "var i1 = document.getElementById('i1');\n"
+ "var i2 = document.getElementById('i2');\n"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ public void setAlign() throws Exception {
+ " function setAlign(elem, value) {\n"
+ " try {\n"
+ " elem.align = value;\n"
+ " } catch(e) { log('error'); }\n"
+ " } catch(e) { logEx(e); }\n"
+ " log(elem.align);\n"
+ " }\n"

Expand Down Expand Up @@ -1161,7 +1161,7 @@ public void ctorImage() throws Exception {
* @throws Exception if an error occurs
*/
@Test
@Alerts("error")
@Alerts("TypeError")
public void ctorHTMLImageElement() throws Exception {
final String html
= "<html>\n"
Expand All @@ -1172,7 +1172,7 @@ public void ctorHTMLImageElement() throws Exception {
+ " try {\n"
+ " var htmlImageElement = new HTMLImageElement(1, 1);"
+ " log('' + htmlImageElement);\n"
+ " } catch(e) { log('error'); }\n"
+ " } catch(e) { logEx(e); }\n"
+ " }\n"
+ " </script>\n"
+ " </head>\n"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1574,7 +1574,7 @@ public void typeCase() throws Exception {
+ " try {\n"
+ " f.type = 'CHECKBOX';\n"
+ " log(f.type + ' ' + f.getAttribute('type'));\n"
+ " } catch(e) { log('error');}\n"
+ " } catch(e) { logEx(e); }\n"
+ "}\n"
+ "</script></head>\n"
+ "<body onload='test()'>\n"
Expand Down Expand Up @@ -1729,7 +1729,7 @@ public void setAlign() throws Exception {
+ " function setAlign(elem, value) {\n"
+ " try {\n"
+ " elem.align = value;\n"
+ " } catch(e) { log('error'); }\n"
+ " } catch(e) { logEx(e); }\n"
+ " log(elem.align);\n"
+ " }\n"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public void setAlign() throws Exception {
+ " function setAlign(elem, value) {\n"
+ " try {\n"
+ " elem.align = value;\n"
+ " } catch(e) { log('error'); }\n"
+ " } catch(e) { logEx(e); }\n"
+ " log(elem.align);\n"
+ " }\n"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,22 +132,22 @@ public void type() throws Exception {
+ " log(document.getElementById('menu4').getAttribute('type'));\n"
+ " log(document.getElementById('menu5').getAttribute('type'));\n"

+ " try { document.getElementById('menu1').type = 'list' } catch(e) {log('ex');}\n"
+ " try { document.getElementById('menu1').type = 'list' } catch(e) { logEx(e); }\n"
+ " log(document.getElementById('menu1').type);\n"

+ " try { document.getElementById('menu1').type = 'context' } catch(e) {log('ex');}\n"
+ " try { document.getElementById('menu1').type = 'context' } catch(e) { logEx(e); }\n"
+ " log(document.getElementById('menu1').type);\n"

+ " try { document.getElementById('menu1').type = 'toolbar' } catch(e) {log('ex');}\n"
+ " try { document.getElementById('menu1').type = 'toolbar' } catch(e) { logEx(e); }\n"
+ " log(document.getElementById('menu1').type);\n"

+ " try { document.getElementById('menu1').type = 'ConText' } catch(e) {log('ex');}\n"
+ " try { document.getElementById('menu1').type = 'ConText' } catch(e) { logEx(e); }\n"
+ " log(document.getElementById('menu1').type);\n"

+ " try { document.getElementById('menu1').type = '' } catch(e) {log('ex');}\n"
+ " try { document.getElementById('menu1').type = '' } catch(e) { logEx(e); }\n"
+ " log(document.getElementById('menu1').type);\n"

+ " try { document.getElementById('menu1').type = 'unknown' } catch(e) {log('ex');}\n"
+ " try { document.getElementById('menu1').type = 'unknown' } catch(e) { logEx(e); }\n"
+ " log(document.getElementById('menu1').type);\n"
+ " }\n"
+ " </script>\n"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,7 @@ public void align() throws Exception {
+ " function set(e, value) {\n"
+ " try {\n"
+ " e.align = value;\n"
+ " } catch(e) {\n"
+ " log('error');\n"
+ " }\n"
+ " } catch(e) { logEx(e); }\n"
+ " }\n"
+ " </script>\n"
+ " </head>\n"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public void setAlign() throws Exception {
+ " function setAlign(elem, value) {\n"
+ " try {\n"
+ " elem.align = value;\n"
+ " } catch(e) { log('error'); }\n"
+ " } catch(e) { logEx(e); }\n"
+ " log(elem.align);\n"
+ " }\n"

Expand Down Expand Up @@ -117,9 +117,7 @@ public void vAlign() throws Exception {
+ " function set(e, value) {\n"
+ " try {\n"
+ " e.vAlign = value;\n"
+ " } catch(e) {\n"
+ " log('error');\n"
+ " }\n"
+ " } catch(e) { logEx(e); }\n"
+ " }\n"
+ " var c1 = document.getElementById('c1');\n"
+ " var c2 = document.getElementById('c2');\n"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,7 @@ public void align() throws Exception {
+ " function set(e, value) {\n"
+ " try {\n"
+ " e.align = value;\n"
+ " } catch(e) {\n"
+ " log('error');\n"
+ " }\n"
+ " } catch(e) { logEx(e); }\n"
+ " }\n"
+ " var td1 = document.getElementById('td1');\n"
+ " var td2 = document.getElementById('td2');\n"
Expand Down Expand Up @@ -161,9 +159,7 @@ public void vAlign() throws Exception {
+ " function set(e, value) {\n"
+ " try {\n"
+ " e.vAlign = value;\n"
+ " } catch(e) {\n"
+ " log('error');\n"
+ " }\n"
+ " } catch(e) { logEx(e); }\n"
+ " }\n"
+ " var td1 = document.getElementById('td1');\n"
+ " var td2 = document.getElementById('td2');\n"
Expand Down Expand Up @@ -300,9 +296,7 @@ public void colSpan() throws Exception {
+ " function set(e, value) {\n"
+ " try {\n"
+ " e.colSpan = value;\n"
+ " } catch(e) {\n"
+ " log('error');\n"
+ " }\n"
+ " } catch(e) { logEx(e); }\n"
+ " }\n"
+ " var td1 = document.getElementById('td1');\n"
+ " var td2 = document.getElementById('td2');\n"
Expand Down Expand Up @@ -438,9 +432,7 @@ public void rowSpan() throws Exception {
+ " function set(e, value) {\n"
+ " try {\n"
+ " e.rowSpan = value;\n"
+ " } catch(e) {\n"
+ " log('error');\n"
+ " }\n"
+ " } catch(e) { logEx(e); }\n"
+ " }\n"
+ " var td1 = document.getElementById('td1');\n"
+ " var td2 = document.getElementById('td2');\n"
Expand Down Expand Up @@ -703,9 +695,7 @@ public void width() throws Exception {
+ " function set(e, value) {\n"
+ " try {\n"
+ " e.width = value;\n"
+ " } catch(e) {\n"
+ " log('error');\n"
+ " }\n"
+ " } catch(e) { logEx(e); }\n"
+ " }\n"
+ " function test() {\n"
+ " var td = document.getElementById('td');\n"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public void setAlign() throws Exception {
+ " function setAlign(elem, value) {\n"
+ " try {\n"
+ " elem.align = value;\n"
+ " } catch(e) { log('error'); }\n"
+ " } catch(e) { logEx(e); }\n"
+ " log(elem.align);\n"
+ " }\n"

Expand Down Expand Up @@ -194,9 +194,7 @@ public void span() throws Exception {
+ " function set(e, value) {\n"
+ " try {\n"
+ " e.span = value;\n"
+ " } catch(e) {\n"
+ " log('error');\n"
+ " }\n"
+ " } catch(e) { logEx(e); }\n"
+ " }\n"
+ " var c1 = document.getElementById('c1');\n"
+ " var c2 = document.getElementById('c2');\n"
Expand Down Expand Up @@ -238,9 +236,7 @@ public void vAlign() throws Exception {
+ " function set(e, value) {\n"
+ " try {\n"
+ " e.vAlign = value;\n"
+ " } catch(e) {\n"
+ " log('error');\n"
+ " }\n"
+ " } catch(e) { logEx(e); }\n"
+ " }\n"
+ " var c1 = document.getElementById('c1');\n"
+ " var c2 = document.getElementById('c2');\n"
Expand Down Expand Up @@ -286,9 +282,7 @@ public void width() throws Exception {
+ " function set(e, value) {\n"
+ " try {\n"
+ " e.width = value;\n"
+ " } catch(e) {\n"
+ " log('error');\n"
+ " }\n"
+ " } catch(e) { logEx(e); }\n"
+ " }\n"
+ " var c1 = document.getElementById('c1');\n"
+ " var c2 = document.getElementById('c2');\n"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -653,9 +653,7 @@ public void refresh() throws Exception {
+ " } else {\n"
+ " log('no refresh function');\n"
+ " }\n"
+ " } catch(e) {\n"
+ " log('error');\n"
+ " }\n"
+ " } catch(e) { logEx(e); }\n"
+ " }\n"
+ "</script></head><body onload='test()'>\n"
+ "<table id='myTable'></table>\n"
Expand Down Expand Up @@ -689,9 +687,7 @@ public void align() throws Exception {
+ " function set(e, value) {\n"
+ " try {\n"
+ " e.align = value;\n"
+ " } catch(e) {\n"
+ " log('error');\n"
+ " }\n"
+ " } catch(e) { logEx(e); }\n"
+ " }\n"
+ " </script>\n"
+ " </head>\n"
Expand Down Expand Up @@ -753,11 +749,11 @@ public void innerText() throws Exception {
+ " log(node.innerText);\n"
+ " log(node.firstChild);\n"

+ " try { node.innerText = 'abc'; } catch(e) {log('ex');}\n"
+ " try { node.innerText = 'abc'; } catch(e) { logEx(e); }\n"
+ " log(node.innerText);\n"
+ " log(node.firstChild);\n"

+ " try { node.innerText = ''; } catch(e) {log('ex');}\n"
+ " try { node.innerText = ''; } catch(e) { logEx(e); }\n"
+ " log(node.innerText);\n"
+ "</script></body></html>";

Expand All @@ -781,11 +777,11 @@ public void textContent() throws Exception {
+ " log(node.textContent);\n"
+ " log(node.firstChild);\n"

+ " try { node.textContent = 'abc'; } catch(e) {log('ex');}\n"
+ " try { node.textContent = 'abc'; } catch(e) { logEx(e); }\n"
+ " log(node.textContent);\n"
+ " log(node.firstChild);\n"

+ " try { node.textContent = ''; } catch(e) {log('ex');}\n"
+ " try { node.textContent = ''; } catch(e) { logEx(e); }\n"
+ " log(node.textContent);\n"
+ "</script></body></html>";

Expand Down Expand Up @@ -974,7 +970,7 @@ public void setRules() throws Exception {
+ " function setRules(elem, value) {\n"
+ " try {\n"
+ " elem.rules = value;\n"
+ " } catch(e) { log('error'); }\n"
+ " } catch(e) { logEx(e); }\n"
+ " log(elem.rules);\n"
+ " }\n"

Expand Down
Loading

0 comments on commit 2e56a64

Please sign in to comment.