Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / inspector / tracing / timeline-time.html
blob2ce0e43dfabfed0bbf9f70abf6fd8ace6d42ba89
1 <html>
2 <head>
3 <script src="../../http/tests/inspector/inspector-test.js"></script>
4 <script src="../../http/tests/inspector/timeline-test.js"></script>
5 <script>
7 function simpleConsoleTime()
9 console.time("a");
10 console.timeEnd("a");
13 function nestedConsoleTime()
15 console.time("a");
17 console.time("b");
18 console.timeEnd("b");
20 console.time("c");
22 console.time("d");
23 console.timeEnd("d");
25 console.timeEnd("c");
28 console.timeEnd("a");
32 function unbalancedConsoleTime()
34 console.time("a");
35 console.time("b");
36 console.timeEnd("a");
37 console.timeEnd("b");
40 function consoleTimeWithoutConsoleTimeEnd()
42 console.timeStamp("Foo");
43 console.time("a");
44 console.timeStamp("Bar");
45 console.time("b");
46 console.time("c");
47 console.time("d");
48 console.timeStamp("Baz");
49 console.timeEnd("d");
52 function test()
54 InspectorTest.runTestSuite([
55 function testSimpleConsoleTime(next)
57 performActions("simpleConsoleTime()", next);
60 function testNestedConsoleTime(next)
62 performActions("nestedConsoleTime()", next);
65 function testUnbalancedConsoleTime(next)
67 performActions("unbalancedConsoleTime()", next);
70 function testConsoleTimeWithoutConsoleTimeEnd(next)
72 performActions("consoleTimeWithoutConsoleTimeEnd()", next);
74 ]);
76 function performActions(actions, next)
78 function callback()
80 var rootRecord = InspectorTest.timelinePresentationModel().rootRecord();
81 InspectorTest.dumpPresentationRecord(rootRecord, undefined, undefined, ["FunctionCall", "ConsoleTime", "TimeStamp"]);
82 InspectorTest.timelinePresentationModel().reset();
83 next();
85 InspectorTest.evaluateWithTimeline(actions, InspectorTest.safeWrap(callback));
89 </script>
90 </head>
92 <body onload="runTest()">
93 <p>Test nesting of time/timeEnd records on Timeline</p>
95 </body>
96 </html>