service worker: Queue Client.postMessage() until DOMContentLoaded.
This introduces the enabling/disabling mechanism for the client message queue as described in: https://w3c.github.io/ServiceWorker/#dfn-client-message-queue The client message queue should be disabled until one of the following occurs: * DOMContentLoaded is fired[1] * startMessages() is called (not yet implemented) * onmessage is assigned to (not yet implemented) This CL enables the queue on DOMContentLoaded. This makes partially makes the WPT test postmessage-to-client-message-queue.https.html pass. The test case "Messages from ServiceWorker to Client only received after DOMContentLoaded event." passes. But the test file still times out because the other triggers are not implemented. It will also be flaky until bug 924958 is fixed. [1] At https://html.spec.whatwg.org/multipage/parsing.html#the-end: 1. Fire an event named DOMContentLoaded at the Document object, with its bubbles attribute initialized to true. 2. Enable the client message queue of the ServiceWorkerContainer object whose associated service worker client is the Document object's relevant settings object. Bug: 915685 Change-Id: Ifcd84687f70f98f1558b35b0e3044a7c4662a567 Reviewed-on: https://chromium-review.googlesource.com/c/1441657 Commit-Queue: Matt Falkenhagen <falken@chromium.org> Reviewed-by:Kenichi Ishibashi <bashi@chromium.org> Cr-Commit-Position: refs/heads/master@{#626918}
Showing
Please register or sign in to comment