blob: b644eb31754d83155fdbbca4b9808772eb4d49a9 [file] [log] [blame]
<html>
<head>
<script type="text/javascript" src="../../http/tests/inspector-protocol/inspector-protocol-test.js"></script>
<script>
function collectProfiles()
{
console.profile();
console.profile("titled");
console.profileEnd();
console.profileEnd();
}
function test()
{
InspectorTest.fail = function(message)
{
InspectorTest.log("FAIL: " + message);
InspectorTest.completeTest();
}
InspectorTest.sendCommand("Profiler.enable", {});
InspectorTest.sendCommand("Runtime.evaluate", { expression: "collectProfiles()"}, didCollectProfiles);
var headers = [];
InspectorTest.eventHandler["Profiler.consoleProfileFinished"] = function(messageObject)
{
headers.push({
title: messageObject["params"]["title"]
});
}
function didCollectProfiles(messageObject)
{
if (headers.length !== 2)
return InspectorTest.fail("Cannot retrive headers: " + JSON.stringify(messageObject, null, 4));
InspectorTest.log("SUCCESS: found 2 profile headers");
for (var i = 0; i < headers.length; i++) {
if (headers[i].title === "titled") {
InspectorTest.log("SUCCESS: titled profile found");
InspectorTest.completeTest();
return;
}
}
InspectorTest.fail("Cannot find titled profile");
}
}
</script>
</head>
<body onload="runTest()">
<p>
Tests that "console.profileEnd()" does not cause crash.<br>
<a href="https://bugs.webkit.org/show_bug.cgi?id=105759">Bug 105759.</a><br>
</p>
</body>
</html>