summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/manual-tests/inspector/console-time.html
blob: 6c243736d4e0627d34f7432c542de21bbb4e3173 (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
<script>
function test() {
    // Test 1: call timeEnd before time
    console.log(">>>console.timeEnd(\"1\")");
    console.timeEnd("1");
    // Test 2: call time two times before timeEnd
    console.log(">>>console.time(\"2\")");
    console.time("2");
    setTimeout(function() {
        console.log(">>>console.time(\"2\")");
        console.time("2");
        console.log(">>>console.timeEnd(\"2\")");
        console.timeEnd("2");
        console.log("2: If it says ~1000ms the first time is not overwritten.");
    }, 1000);
    // Test 3: call timeEnd two times
    console.log(">>>console.time(\"3\")");
    console.time("3");
    console.log(">>>console.timeEnd(\"3\")");
    console.timeEnd("3");
    console.log(">>>console.timeEnd(\"3\")");
    console.timeEnd("3");
    // Test 4: call time/timeEnd without title parameter
    console.log(">>>console.time()");
    console.time();
    console.log(">>>console.timeEnd()");
    console.timeEnd();
};

</script>
<p>Test for <a href="https://bugs.webkit.org/show_bug.cgi?id=19159">Bug 19159: Inspector should support console.time/console.timeEnd</a>.</p>
<p>Open the Inspector (right-click and choose "Inspect Element"), then click the "Run Tests" button.</p>
<button onclick="test()">Run Tests</button>