dom/tests/browser/test-console-api.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dom/tests/browser/test-console-api.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,69 @@
     1.4 +<!DOCTYPE HTML>
     1.5 +<html dir="ltr" xml:lang="en-US" lang="en-US"><head>
     1.6 +    <title>Console API test page</title>
     1.7 +    <script type="text/javascript">
     1.8 +      window.foobar585956c = function(a) {
     1.9 +        console.trace();
    1.10 +        return a+"c";
    1.11 +      };
    1.12 +
    1.13 +      function foobar585956b(a) {
    1.14 +        return foobar585956c(a+"b");
    1.15 +      }
    1.16 +
    1.17 +      function foobar585956a(omg) {
    1.18 +        return foobar585956b(omg + "a");
    1.19 +      }
    1.20 +
    1.21 +      function foobar646025(omg) {
    1.22 +        console.log(omg, "o", "d");
    1.23 +      }
    1.24 +
    1.25 +      function startTimer(timer) {
    1.26 +        console.time(timer);
    1.27 +      }
    1.28 +
    1.29 +      function stopTimer(timer) {
    1.30 +        console.timeEnd(timer);
    1.31 +      }
    1.32 +
    1.33 +      function namelessTimer() {
    1.34 +        console.time();
    1.35 +        console.timeEnd();
    1.36 +      }
    1.37 +
    1.38 +      function test() {
    1.39 +        var str = "Test Message."
    1.40 +        console.foobar(str); // if this throws, we don't execute following funcs
    1.41 +        console.log(str);
    1.42 +        console.info(str);
    1.43 +        console.warn(str);
    1.44 +        console.error(str);
    1.45 +        console.exception(str);
    1.46 +        console.assert(false, str);
    1.47 +        console.count(str);
    1.48 +      }
    1.49 +
    1.50 +      function testGroups() {
    1.51 +        console.groupCollapsed("a", "group");
    1.52 +        console.group("b", "group");
    1.53 +        console.groupEnd("b", "group");
    1.54 +      }
    1.55 +
    1.56 +      function nativeCallback() {
    1.57 +        new Promise(function(resolve, reject) { resolve(42); }).then(console.log.bind(console));
    1.58 +      }
    1.59 +    </script>
    1.60 +  </head>
    1.61 +  <body>
    1.62 +    <h1>Console API Test Page</h1>
    1.63 +    <button onclick="test();">Log stuff</button>
    1.64 +    <button id="test-trace" onclick="foobar585956a('omg');">Test trace</button>
    1.65 +    <button id="test-location" onclick="foobar646025('omg');">Test location</button>
    1.66 +    <button id="test-nativeCallback" onclick="nativeCallback();">Test nativeCallback</button>
    1.67 +    <button id="test-groups" onclick="testGroups();">Test groups</button>
    1.68 +    <button id="test-time" onclick="startTimer('foo');">Test time</button>
    1.69 +    <button id="test-timeEnd" onclick="stopTimer('foo');">Test timeEnd</button>
    1.70 +    <button id="test-namelessTimer" onclick="namelessTimer();">Test namelessTimer</button>
    1.71 +  </body>
    1.72 +</html>

mercurial