sendMessageToFrontend is supposed to work asynchronously, not re-entering any of the JavaScript or rendering code. So far it is achieved by the dispatcher's setTimeout on the front-end side. We should migrate to native timers instead. Note that this would also require testing harness to be reimplemented.
Closing as invalid, as this bug pertains to the old inspector UI and/or its tests. Please file a new bug (https://www.webkit.org/new-inspector-bug) if the bug/feature/issue is still relevant to WebKit trunk.