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,7 +24,11 @@ navigator.serviceWorker.getRegistration(SCOPE)
})
.then(function(worker) {
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) {
if (event.target.state != 'activated')
......@@ -42,6 +46,10 @@ function on_message(e) {
})
.then(function() {
window.parent.postMessage(e.data, host_info['HTTP_ORIGIN']);
});
})
.catch(function(reason) {
window.parent.postMessage({results: 'FAILURE: ' + reason.message},
host_info['HTTP_ORIGIN']);
});
}
</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