Commit 08cb4ee0 authored by horo@chromium.org's avatar horo@chromium.org

[ServiceWorker] Add error handling code fetch-mixed-content-iframe.html to avoid timeouts.

BUG=426047

Review URL: https://codereview.chromium.org/672423003

git-svn-id: svn://svn.chromium.org/blink/trunk@184333 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 0c06ca8c
...@@ -24,6 +24,10 @@ navigator.serviceWorker.getRegistration(SCOPE) ...@@ -24,6 +24,10 @@ navigator.serviceWorker.getRegistration(SCOPE)
}) })
.then(function(worker) { .then(function(worker) {
worker.addEventListener('statechange', on_state_change); worker.addEventListener('statechange', on_state_change);
})
.catch(function(reason) {
window.parent.postMessage({results: 'FAILURE: ' + reason.message},
host_info['HTTP_ORIGIN']);
}); });
function on_state_change(event) { function on_state_change(event) {
...@@ -42,6 +46,10 @@ function on_message(e) { ...@@ -42,6 +46,10 @@ function on_message(e) {
}) })
.then(function() { .then(function() {
window.parent.postMessage(e.data, host_info['HTTP_ORIGIN']); window.parent.postMessage(e.data, host_info['HTTP_ORIGIN']);
})
.catch(function(reason) {
window.parent.postMessage({results: 'FAILURE: ' + reason.message},
host_info['HTTP_ORIGIN']);
}); });
} }
</script> </script>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment