| <html> |
| <head> |
| <script src="../../http/tests/inspector/inspector-test.js"></script> |
| <script src="../../http/tests/inspector/console-test.js"></script> |
| <script> |
| |
| function logToConsole() |
| { |
| console.table(); |
| console.table(null); |
| |
| console.log("Array of arrays"); |
| console.table([[1,2,3], [4,5,6]]); |
| |
| console.log("Large array of arrays"); |
| console.table([[1,2,3], [4,5,6], [1,2,3], [4,5,6], [1,2,3], [4,5,6], [1,2,3], [4,5,6]]); |
| |
| console.log("Array or array and object"); |
| console.table([[1,2,3], {a:1, b:2, c:3}]); |
| |
| console.log("Object table"); |
| console.table({"foo": {a:1, b:2}, "bar": {a:3, b:4}}); |
| |
| console.log("Null as columns"); |
| console.table([[1,2,3], [4,5,6]], null); |
| |
| console.log("Digit as columns"); |
| console.table([[1,2,3], [4,5,6]], 0); |
| |
| console.log("String as columns"); |
| console.table([[1,2,3], [4,5,6]], "0"); |
| |
| console.log("Random string as columns"); |
| console.table([[1,2,3], [4,5,6]], "Foo"); |
| |
| console.log("Array of strings as columns"); |
| console.table([{a:1, b:2, c:3}, {a:"foo", b:"bar"}], ["a", "b"]); |
| |
| console.log("Good and bad column names"); |
| console.table([{a:1, b:2, c:3}, {a:"foo"}], ["a", "b", "d"]); |
| |
| console.log("Missing column name"); |
| console.table([{a:1, b:2, c:3}, {a:"foo"}], ["d"]); |
| } |
| |
| function onload() |
| { |
| logToConsole(); |
| runTest(); |
| } |
| |
| function test() |
| { |
| InspectorTest.evaluateInPage("logToConsole()", callback); |
| |
| function callback() |
| { |
| InspectorTest.dumpConsoleMessages(); |
| InspectorTest.completeTest(); |
| } |
| } |
| </script> |
| </head> |
| |
| <body onload="onload()"> |
| <p> |
| Tests console.table. |
| </p> |
| </body> |
| </html> |