| Index: LayoutTests/inspector/console/console-timeline.html
|
| diff --git a/LayoutTests/inspector/console/console-timeline.html b/LayoutTests/inspector/console/console-timeline.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..156834fa656a6c4989c8fe6aebc1755ed7252de0
|
| --- /dev/null
|
| +++ b/LayoutTests/inspector/console/console-timeline.html
|
| @@ -0,0 +1,92 @@
|
| +<html>
|
| +<head>
|
| +<script src="../../http/tests/inspector/inspector-test.js"></script>
|
| +<script src="../../http/tests/inspector/console-test.js"></script>
|
| +<script src="../../http/tests/inspector/timeline-test.js"></script>
|
| +<script>
|
| +
|
| +function startStopTimeline()
|
| +{
|
| + console.timeline("one");
|
| + console.timeStamp("timestamp");
|
| + console.timelineEnd("one");
|
| +}
|
| +
|
| +function startStopMultiple()
|
| +{
|
| + console.timeline("one");
|
| + console.timeStamp("timestamp 1");
|
| + console.timeline("one");
|
| + console.timeline("two");
|
| + console.timeline("two");
|
| + console.timelineEnd("two");
|
| + console.timeStamp("timestamp 2");
|
| + console.timelineEnd("one");
|
| + console.timeStamp("timestamp 3");
|
| + console.timelineEnd("two");
|
| + console.timeStamp("timestamp 4");
|
| + console.timelineEnd("one");
|
| + console.timeStamp("timestamp 5");
|
| +}
|
| +
|
| +function stopUnknown()
|
| +{
|
| + console.timeline("one");
|
| + console.timeStamp("timestamp 1");
|
| + console.timelineEnd("two");
|
| + console.timeStamp("timestamp 2");
|
| + console.timelineEnd("one");
|
| + console.timeStamp("timestamp 3");
|
| +}
|
| +
|
| +function test()
|
| +{
|
| + var records = [];
|
| + WebInspector.timelineManager.addEventListener(WebInspector.TimelineManager.EventTypes.TimelineEventRecorded, eventRecorded);
|
| +
|
| + InspectorTest.runTestSuite([
|
| + function testStartStopTimeline(next)
|
| + {
|
| + InspectorTest.evaluateInPage("startStopTimeline()", dumpTimelineRecords(next));
|
| + },
|
| +
|
| + function testStartStopMultiple(next)
|
| + {
|
| + InspectorTest.evaluateInPage("startStopMultiple()", dumpTimelineRecords(next));
|
| + },
|
| +
|
| + function testStopUnknown(next)
|
| + {
|
| + InspectorTest.evaluateInPage("stopUnknown()", dumpTimelineRecords(next));
|
| + }
|
| + ]);
|
| +
|
| + function eventRecorded(event)
|
| + {
|
| + records.push(event.data);
|
| + }
|
| +
|
| + function dumpTimelineRecords(next)
|
| + {
|
| + return function()
|
| + {
|
| + for (var i = 0; i < records.length; ++i) {
|
| + if (records[i].type === "TimeStamp")
|
| + InspectorTest.addResult(records[i].data.message);
|
| + }
|
| + records = [];
|
| + next();
|
| + }
|
| + }
|
| +}
|
| +
|
| +</script>
|
| +</head>
|
| +
|
| +<body onload="runTest()">
|
| +<p>
|
| +Tests console.timeline and timelineEnd commands.
|
| +</p>
|
| +
|
| +</body>
|
| +</html>
|
|
|