Home | History | Annotate | Download | only in inspector
      1 <html>
      2 <head>
      3     <script>
      4     function generateErrors(number)
      5     {
      6         for (var i = 0; i < number; ++i)
      7             console.error("This is an error.");
      8     }
      9 
     10     function generateLogs(number)
     11     {
     12         for (var i = 0; i < number; ++i)
     13             console.log("This is a log.");
     14     }
     15 
     16     function generateWarnings(number)
     17     {
     18         for (var i = 0; i < number; ++i)
     19             console.warn("This is a warning.");
     20     }
     21 
     22     function generateInfos(number)
     23     {
     24         for (var i = 0; i < number; ++i)
     25             console.info("This is an info.");
     26     }
     27     
     28     function startTest()
     29     {
     30         generateErrors(3);
     31         generateLogs(3);
     32         generateWarnings(3);
     33         
     34         console.group();
     35 
     36         generateErrors(2);
     37         generateLogs(1);
     38         generateErrors(2);
     39 
     40         generateLogs(2);
     41         generateWarnings(1);
     42         generateLogs(2);
     43 
     44         generateWarnings(2);
     45         generateErrors(1);
     46         generateWarnings(2);
     47         
     48         console.groupEnd();
     49 
     50         generateErrors(1);
     51         console.group();
     52         generateErrors(1);
     53         console.group();
     54         generateErrors(1);
     55         console.groupEnd();
     56         generateErrors(1);
     57         console.groupEnd();
     58         generateErrors(1);
     59         
     60         console.warn("Same message, different level");
     61         console.error("Same message, different level");
     62         console.log("Same message, different level");
     63         console.info("Same message, different level");
     64         
     65         console.log("Variadic message: %s", "message 1");
     66         console.log("Variadic message: %s", "message 2");
     67         console.log("Variadic message: %s", "message 3");
     68         console.log("Variadic message: %s", "message 4");
     69         
     70         console.warn("Warning and error on same line."); console.error("Warning and error on same line."); console.warn("Warning and error on same line."); console.error("Warning and error on same line.");
     71         
     72     }
     73     </script>
     74 </head>
     75 <body onload="startTest()">
     76 This test generates warnings, errors, and logs to test the grouping of repeated
     77 messages in the Web Inspector.  To check this test open the Web Inspector and see
     78 that there are never any repeated messages that don't have a number next to them.
     79 <br>
     80 <br>
     81 <input type="button" onclick="generateErrors(1)" value="Put Error in Console"></input>
     82 <br>
     83 <input type="button" onclick="generateLogs(1)" value="Put Log in Console"></input>
     84 <br>
     85 <input type="button" onclick="generateWarnings(1)" value="Put Warning in Console"></input>
     86 </body>
     87