summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/inspector/console/console-clear.html
blob: e5ec6f005f8b7e570a0c89150fdddfe9a8c52f73 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<html>
<head>
<script src="../../http/tests/inspector/inspector-test.js"></script>
<script src="../../http/tests/inspector/console-test.js"></script>
<script>

function log() {
    // Fill console.
    console.log("one");
    console.log("two");
    console.log("three");
}

log();

function test()
{

    InspectorTest.addResult("=== Before clear ==="); 
    InspectorTest.dumpConsoleMessages();

    WebInspector.console.requestClearMessages();
    
    function callback()
    {
        InspectorTest.addResult("=== After clear ==="); 
        InspectorTest.dumpConsoleMessages();
        InspectorTest.completeTest();
    }
    InspectorTest.runAfterPendingDispatches(callback);
}

</script>
</head>

<body onload="runTest()">
<p>
Tests that console is cleared upon requestClearMessages call.
</p>

</body>
</html>