chromium/third_party/blink/web_tests/fast/workers/chromium/worker-console-log.html

<!DOCTYPE html>
<html>
<head>
    <script>
        window.isOnErrorTest = true;
    </script>
    <script src="../../../resources/js-test.js"></script>
    <script>
        function buildInlineWorker() {
            var script = document.getElementById('workerCode').innerText;
            var blob = new Blob([script], {type: 'text/javascript'});
            var worker = new Worker(URL.createObjectURL(blob));

            worker.addEventListener('message', function (e) {
                if (e.data.done)
                    return finishJSTest();
            });

            return worker;
        }
    </script>
</head>
<body>
    <!-- This script's body will be used to build a Blob URL to use as a Worker. -->
    <script id="workerCode" type="text/plain">
        console.log("log");
        console.log(typeof console.log);
        console.log(console.log.toString());
        console.error("error");
        console.warn("warn");
        console.info("info");
        console.debug("debug");
        console.count("count");
        console.time("time");
        /*
        // FIXME(slightlyoff): these aren't getting logged properly from here!
        console.timeEnd("time");
        */
        console.assert(true);
        console.assert(false);
        this.postMessage({ done: true });
    </script>
    <script>
        window.jsTestIsAsync = true;
        description("This tests that 'console.log' and friends function correctly from workers.");
        buildInlineWorker();
    </script>
</body>
</html>