chromium/third_party/blink/web_tests/external/wpt/workers/support/Worker-timeout-cancel-order.js

// The test will create 2 timeouts and cancel the first one. If only the second
// timeout executes then the test passes.
self.addEventListener('message', function(e) {
    var t1 = setTimeout(function () { postMessage(1); }, 5);
    setTimeout(function () { postMessage(2); }, 10);
    clearTimeout(t1);
}, false);