<!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>
