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

Unified Diff: third_party/WebKit/LayoutTests/fast/files/null-origin-string.html

Issue 2741513002: [Merge M-57] Add a warning for the deprecation of content-initiated data URL navigations (Closed)
Patch Set: Created 3 years, 9 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: third_party/WebKit/LayoutTests/fast/files/null-origin-string.html
diff --git a/third_party/WebKit/LayoutTests/fast/files/null-origin-string.html b/third_party/WebKit/LayoutTests/fast/files/null-origin-string.html
index 85a0c0a77293d87253fbd86953ac6f545175a82f..636a8230f34f7798a578c619e741d99e4333a720 100644
--- a/third_party/WebKit/LayoutTests/fast/files/null-origin-string.html
+++ b/third_party/WebKit/LayoutTests/fast/files/null-origin-string.html
@@ -1,7 +1,10 @@
<!DOCTYPE html>
<html>
<body>
-<script> /* This script will be executed in a subframe. */
+<script>
+/* This script will be executed in a subframe. Do not use double slash comments
+ or double quotes in this script tag, they break the test because of innerText
+ call below. */
function runTest()
{
eventSender.beginDragWithFiles(['resources/UTF8.txt']);
@@ -15,8 +18,7 @@ function onInputFileChange()
var reader = new FileReader();
reader.readAsText(file);
console.log('Started reading...');
-
- top.location = 'data:text/html,<p>PASS if no crash.</p><script>testRunner.notifyDone()</scr' + 'ipt>';
+ top.postMessage('navigateToSuccess', '*');
}
</script>
@@ -25,7 +27,16 @@ if (window.eventSender) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
}
-document.write('<iframe src="data:text/html,<input type=file id=file onchange=\'onInputFileChange()\'><script>' + document.getElementsByTagName("script")[0].innerText + 'runTest()</scr' + 'ipt>" style="left:0px;top:0px"></iframe>');
+document.write(
+ '<script>' +
+ 'window.onmessage = function(evt){' +
+ ' if (evt.data == "navigateToSuccess") {' +
+ ' window.location = "resources/notify-no-crash.html";' +
+ ' }' +
+ '}' +
+ '</scr' + 'ipt>' +
+ '<iframe src="data:text/html,<input type=file id=file onchange=\'onInputFileChange()\'><script>' +
+ document.getElementsByTagName("script")[0].innerText + 'runTest()</scr' + 'ipt>" style="left:0px;top:0px"></iframe>');
</script>
<p>Test that using FileReader from a document with unique origin doesn't cause a crash.</p>

Powered by Google App Engine
This is Rietveld 408576698