@@ -74,6 +74,15 @@ private void test(final String tagName) throws Exception {
7474 }
7575
7676 private void testString(final String preparation, final String string) throws Exception {
77+ testString(preparation, string, true);
78+ }
79+
80+ private void testInstanceString(final String preparation, final String string) throws Exception {
81+ testString(preparation, string, false);
82+ }
83+
84+ private void testString(final String preparation,
85+ final String string, final boolean fromCtor) throws Exception {
7786 final String html = DOCTYPE_HTML
7887 + "<html><head><script>\n"
7988 + LOG_TEXTAREA_FUNCTION
@@ -96,11 +105,13 @@ private void testString(final String preparation, final String string) throws Ex
96105 + " */\n"
97106 + " function process(object) {\n"
98107 + " var all = [];\n"
99- + " var props = Object.getOwnPropertyNames(object.constructor.prototype);\n"
108+ + " var props = Object.getOwnPropertyNames(object"
109+ + (fromCtor ? ".constructor.prototype" : "") + ");\n"
100110 + " for (i = 0; i < props.length; i++) {\n"
101111 + " var property = props[i];\n"
102112
103- + " let desc = Object.getOwnPropertyDescriptor(object.constructor.prototype, property);\n"
113+ + " let desc = Object.getOwnPropertyDescriptor(object"
114+ + (fromCtor ? ".constructor.prototype" : "") + ", property);\n"
104115 + " if (desc.get === undefined && typeof object[property] == 'function') {\n"
105116 + " all.push(property + '()');\n"
106117 + " } else {\n"
@@ -18588,4 +18599,39 @@ public void domMatrix() throws Exception {
1858818599 public void notification() throws Exception {
1858918600 testString("", "new Notification('not')");
1859018601 }
18602+
18603+ /**
18604+ * Test console.
18605+ *
18606+ * @throws Exception if the test fails
18607+ */
18608+ @Test
18609+ @Alerts(CHROME = "assert(),clear(),context(),count(),countReset(),createTask(),debug(),dir(),dirxml(),error(),"
18610+ + "group(),groupCollapsed(),groupEnd(),info(),log(),memory[GSCE],profile(),profileEnd(),table(),"
18611+ + "time(),timeEnd(),timeLog(),timeStamp(),trace(),"
18612+ + "warn()",
18613+ EDGE = "assert(),clear(),context(),count(),countReset(),createTask(),debug(),dir(),dirxml(),error(),"
18614+ + "group(),groupCollapsed(),groupEnd(),info(),log(),memory[GSCE],profile(),profileEnd(),table(),"
18615+ + "time(),timeEnd(),timeLog(),timeStamp(),trace(),"
18616+ + "warn()",
18617+ FF = "assert(),clear(),count(),countReset(),debug(),dir(),dirxml(),error(),exception(),group(),"
18618+ + "groupCollapsed(),groupEnd(),info(),log(),profile(),profileEnd(),table(),time(),timeEnd(),"
18619+ + "timeLog(),timeStamp(),trace(),"
18620+ + "warn()",
18621+ FF_ESR = "assert(),clear(),count(),countReset(),debug(),dir(),dirxml(),error(),exception(),group(),"
18622+ + "groupCollapsed(),groupEnd(),info(),log(),profile(),profileEnd(),table(),time(),timeEnd(),"
18623+ + "timeLog(),timeStamp(),trace(),"
18624+ + "warn()")
18625+ @HtmlUnitNYI(
18626+ CHROME = "assert(),count(),countReset(),debug(),error(),info(),log(),"
18627+ + "time(),timeEnd(),timeLog(),timeStamp(),toSource(),trace(),warn()",
18628+ EDGE = "assert(),count(),countReset(),debug(),error(),info(),log(),"
18629+ + "time(),timeEnd(),timeLog(),timeStamp(),toSource(),trace(),warn()",
18630+ FF = "assert(),count(),countReset(),debug(),error(),info(),log(),"
18631+ + "time(),timeEnd(),timeLog(),timeStamp(),toSource(),trace(),warn()",
18632+ FF_ESR = "assert(),count(),countReset(),debug(),error(),info(),log(),"
18633+ + "time(),timeEnd(),timeLog(),timeStamp(),toSource(),trace(),warn()")
18634+ public void console() throws Exception {
18635+ testInstanceString("", "console");
18636+ }
1859118637}
0 commit comments