diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
commit | 36d22d82aa202bb199967e9512281e9a53db42c9 (patch) | |
tree | 105e8c98ddea1c1e4784a60a5a6410fa416be2de /dom/tests/mochitest/general/test_consoleAPI.html | |
parent | Initial commit. (diff) | |
download | firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip |
Adding upstream version 115.7.0esr.upstream/115.7.0esrupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | dom/tests/mochitest/general/test_consoleAPI.html | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/dom/tests/mochitest/general/test_consoleAPI.html b/dom/tests/mochitest/general/test_consoleAPI.html new file mode 100644 index 0000000000..506fc7f160 --- /dev/null +++ b/dom/tests/mochitest/general/test_consoleAPI.html @@ -0,0 +1,66 @@ +<!DOCTYPE HTML> +<html> +<head> + <title>window.console test</title> + <script src="/tests/SimpleTest/SimpleTest.js"></script> + <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"> +</head> + +<body id="body"> + +<script type="application/javascript"> + +function doTest() { + ok(window.console, "console exists"); + + try { + ok(!console.foo, "random property doesn't throw"); + } catch (ex) { + ok(false, "random property threw: " + ex); + } + + var expectedProps = { + "log": "function", + "info": "function", + "warn": "function", + "error": "function", + "exception": "function", + "debug": "function", + "trace": "function", + "dir": "function", + "group": "function", + "groupCollapsed": "function", + "groupEnd": "function", + "time": "function", + "timeLog": "function", + "timeEnd": "function", + "profile": "function", + "profileEnd": "function", + "assert": "function", + "count": "function", + "countReset": "function", + "table": "function", + "clear": "function", + "dirxml": "function", + "timeStamp": "function", + }; + + var foundProps = 0; + for (var prop in console) { + foundProps++; + is(typeof(console[prop]), expectedProps[prop], "expect console prop " + prop + " exists"); + } + is(foundProps, Object.keys(expectedProps).length, "found correct number of properties"); + + SimpleTest.finish(); +} + +SimpleTest.waitForExplicitFinish(); +addLoadEvent(doTest); + +</script> + +<p id="display"></p> + +</body> +</html> |