Commit add02293 authored by Keishi Hattori's avatar Keishi Hattori Committed by Commit Bot

Modify frameset console to use postMessage

To introduce EventLoop concept we can't have AllowUniversalAccessFromFileURLs changing midway, and so we will be making AllowUniversalAccessFromFileURLs false for web_tests by default.

Tests using frameset, write in the frame to show text. Without AllowUniversalAccessFromFileURLs, you cannot write directly into it, so this CL changes them to use postMessage.

Bug=804661

Change-Id: I22a48a6a856f4cb2b14bcc956a2fa2cf47cea3f4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1573521Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Reviewed-by: default avatarTaiju Tsuiki <tzik@chromium.org>
Commit-Queue: Keishi Hattori <keishi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#652512}
parent 9f4031e3
......@@ -23,6 +23,6 @@ function runTests()
</head>
<frameset cols="200,*" border="10" noresize>
<frame id="testFrame" name="testFrame" src="about:blank">
<frame id="results" name="results" src="data:text/html,<p id='description'>This test can only be run using DRT.</p><pre id='console'></pre>">
<frame id="results" name="results" src="data:text/html,<p id='description'>This test can only be run using DRT.</p><pre id='console'></pre><script>window.onmessage = e => { if (e.data.type === 'description') { document.getElementById('description').textContent = e.data.message; } else { document.getElementById('console').appendChild(document.createTextNode(e.data.message + '\n')); } }</script>">
</frameset>
</html>
......@@ -46,6 +46,6 @@ function runTests()
</head>
<frameset cols="200,*" border="10">
<frame id="testFrame" name="testFrame" src="about:blank">
<frame id="results" name="results" src="data:text/html,<p id='description'>This test can only be run using DRT.</p><pre id='console'></pre>">
<frame id="results" name="results" src="data:text/html,<p id='description'>This test can only be run using DRT.</p><pre id='console'></pre><script>window.onmessage = e => { if (e.data.type === 'description') { document.getElementById('description').textContent = e.data.message; } else { document.getElementById('console').appendChild(document.createTextNode(e.data.message + '\n')); } }</script>">
</frameset>
</html>
......@@ -23,6 +23,6 @@ function runTests()
</head>
<frameset cols="200,*" border="10">
<frame id="testFrame" name="testFrame" src="about:blank" noresize>
<frame id="results" name="results" src="data:text/html,<p id='description'>This test can only be run using DRT.</p><pre id='console'></pre>">
<frame id="results" name="results" src="data:text/html,<p id='description'>This test can only be run using DRT.</p><pre id='console'></pre><script>window.onmessage = e => { if (e.data.type === 'description') { document.getElementById('description').textContent = e.data.message; } else { document.getElementById('console').appendChild(document.createTextNode(e.data.message + '\n')); } }</script>">
</frameset>
</html>
......@@ -23,6 +23,6 @@ function runTests()
</head>
<frameset cols="200,*" border="10">
<frame id="testFrame" name="testFrame" src="about:blank" noresize>
<frame id="results" name="results" src="data:text/html,<p id='description'>This test can only be run using DRT.</p><pre id='console'></pre>">
<frame id="results" name="results" src="data:text/html,<p id='description'>This test can only be run using DRT.</p><pre id='console'></pre><script>window.onmessage = e => { if (e.data.type === 'description') { document.getElementById('description').textContent = e.data.message; } else { document.getElementById('console').appendChild(document.createTextNode(e.data.message + '\n')); } }</script>">
</frameset>
</html>
......@@ -4,7 +4,10 @@
<script>
function log(frame, success, isWidth, size) {
if (window.testRunner) {
document.getElementById("results").contentDocument.getElementById("console").appendChild(document.createTextNode((success ? "PASS: " : "FAIL: ") + frame.name + " resized correctly\n"));
document.getElementById("results").contentWindow.postMessage({
type: "log",
message: (success ? "PASS: " : "FAIL: ") + frame.name + " resized correctly"
}, "*");
} else {
frame.document.close();
if (success)
......@@ -30,7 +33,10 @@
testRunner.dumpAsText();
testRunner.dumpChildFrames();
document.getElementById("results").contentDocument.getElementById("description").innerText = "\nThis tests that frames with frameborder=0 can be resized. See WebKit Bug 23750. On success, two 'PASS' messages will be shown below.";
document.getElementById("results").contentWindow.postMessage({
type: "description",
message: "\nThis tests that frames with frameborder=0 can be resized. See WebKit Bug 23750. On success, two 'PASS' messages will be shown below."
}, "*");
// Move the One/* vertical resizer ten pixels west.
eventSender.mouseMoveTo(90, 400);
......@@ -62,7 +68,7 @@
<frame frameborder=0 name="One" style="border-right: 2px solid green;"></frame>
<frameset rows="70,*" onmousemove="checkProgress()" onmouseup="checkProgress()" onmousedown="checkProgress()">
<frame frameborder=0 name="Two" style="border-bottom: 2px solid green;"></frame>
<frame id="results" frameborder=0 name="Three" src="data:text/html,<body bgcolor='gray'> <p id='description'>To resize frames drag the top or left of this frame </p><pre id='console'></pre></body>"></frame>
<frame id="results" frameborder=0 name="Three" src="data:text/html,<body bgcolor='gray'> <p id='description'>To resize frames drag the top or left of this frame </p><pre id='console'</pre><script>window.onmessage = e => { if (e.data.type === 'description') { document.getElementById('description').innerText = e.data.message; } else { document.getElementById('console').appendChild(document.createTextNode(e.data.message + '\n')); } }</script></body>"></frame>
</frameset>
</frameset>
</html>
......@@ -64,10 +64,16 @@ function resizeTestFrameBy(deltaWidthInPixels)
function log(message)
{
document.getElementById("results").contentDocument.getElementById("console").appendChild(document.createTextNode(message + "\n"));
document.getElementById("results").contentWindow.postMessage({
type: "log",
message: message
}, "*");
}
function description(message)
{
document.getElementById("results").contentDocument.getElementById("description").innerText = message;
document.getElementById("results").contentWindow.postMessage({
type: "description",
message: message
}, "*");
}
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