Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(182)

Unified Diff: LayoutTests/http/tests/serviceworker/chromium/resources/fetch-script-onerror-iframe.html

Issue 1151433002: Add LayoutTest for the script error sanitization for ServiceWorker fetched scripts. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: s/messageCallback/message_callback Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: LayoutTests/http/tests/serviceworker/chromium/resources/fetch-script-onerror-iframe.html
diff --git a/LayoutTests/http/tests/serviceworker/chromium/resources/fetch-script-onerror-iframe.html b/LayoutTests/http/tests/serviceworker/chromium/resources/fetch-script-onerror-iframe.html
new file mode 100644
index 0000000000000000000000000000000000000000..63bda0feba0334b093d3b8fdcb494570ce4d9dc4
--- /dev/null
+++ b/LayoutTests/http/tests/serviceworker/chromium/resources/fetch-script-onerror-iframe.html
@@ -0,0 +1,21 @@
+<script src="../../../resources/get-host-info.js"></script>
+<script>
+var host_info = get_host_info();
+
+window.addEventListener('error', function(evt) {
+ window.parent.postMessage(
+ {
+ filename: evt.filename,
+ colno: evt.colno,
+ lineno: evt.lineno,
+ message: evt.message
+ },
+ host_info['HTTP_ORIGIN']);
+ });
+
+window.addEventListener('message', function(evt) {
+ var script = document.createElement('script');
+ script.src = evt.data.url;
+ document.body.appendChild(script);
+ });
+</script>

Powered by Google App Engine
This is Rietveld 408576698