blob: 1e872404776a12e2164d35d28a502765dc9fd912 [file] [log] [blame]
<!doctype html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script src="../../http/tests/inspector/resources/inspector-test.js"></script>
<script>
var string = "string";
var object = {a:1};
var otherObject = {b:2};
var number = 42;
function test()
{
var currentStepIndex = 0;
var steps = [
"console.log('console.log')",
"console.warn('console.warn')",
"console.error('console.error')",
"console.debug('console.debug')",
"console.info('console.info')",
"console.assert(false, 'assertion message')",
"console.trace()",
"console.log('string message', string)",
"console.log('message', object, object)",
"console.error('message', object)",
"console.warn('message', object)",
"console.debug('message', object)",
"console.info('message', object)",
"console.dir(object)",
"console.dirxml(object)",
"console.group('groupName')",
"console.groupEnd('groupName')",
"console.groupCollapsed('collapsedGroupName')",
"console.groupEnd('collapsedGroupName')",
"console.count()",
"console.count()",
"console.count('')",
"console.count(' ')",
"console.count('')",
"console.count(' ')",
"console.count(string)",
"console.count(string)",
"console.count(object)",
"console.count(object)",
"console.count(otherObject)",
"console.count(otherObject)",
"console.count(number)",
"console.count(number)",
];
function remoteObjectJSONFilter(key, value)
{
if (key === "_objectId" || key === "_stackTrace")
return "<filtered>";
return value;
}
WebInspector.logManager.addEventListener(WebInspector.LogManager.Event.MessageAdded, function(event) {
var message = event.data.message;
InspectorTest.assert(message instanceof WebInspector.ConsoleMessage);
InspectorTest.log("\nSTEP: " + steps[currentStepIndex]);
InspectorTest.log(JSON.stringify(message, remoteObjectJSONFilter, " "));
if (++currentStepIndex >= steps.length)
InspectorTest.completeTest();
});
for (var step of steps)
WebInspector.runtimeManager.evaluateInInspectedWindow(step, {objectGroup: "test", doNotPauseOnExceptionsAndMuteConsole: true, generatePreview: true}, function(){});
}
</script>
</head>
<body onload="runTest();">
</body>
</html>