blob: dd773fec74737bc6c8e6f9283071a14b71439994 [file] [log] [blame]
This tests calling setData to set a html in a null origin document. The URL should be sanitized when reading in another document.
To manually test, drag and drop the "1. Drag this" above to "2. Drop here" and "3. Drop here".
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
dragstart in the null origin document:
PASS html is "<meta content=\"secret\"><b onmouseover=\"dangerousCode()\">hello</b><!-- secret-->, world<script>dangerousCode()</script>"
PASS types.includes("text/html") is true
PASS items.some((item) => item.kind == "string" && item.type == "text/html") is true
dragover in the null origin document:
PASS html is ""
PASS types.includes("text/html") is true
PASS items.some((item) => item.kind == "string" && item.type == "text/html") is true
drop in the null origin document:
PASS html is "<meta content=\"secret\"><b onmouseover=\"dangerousCode()\">hello</b><!-- secret-->, world<script>dangerousCode()</script>"
PASS types.includes("text/html") is true
PASS items.some((item) => item.kind == "string" && item.type == "text/html") is true
dragstart in the null origin document:
PASS html is "<meta content=\"secret\"><b onmouseover=\"dangerousCode()\">hello</b><!-- secret-->, world<script>dangerousCode()</script>"
PASS types.includes("text/html") is true
PASS items.some((item) => item.kind == "string" && item.type == "text/html") is true
dragover in the file URL document:
PASS html is ""
PASS types.includes("text/html") is true
PASS items.some((item) => item.kind == "string" && item.type == "text/html") is true
drop in the file URL document:
PASS html.includes("hello") is true
PASS html.includes(", world") is true
PASS html.includes("secret") is false
PASS html.includes("dangerousCode") is false
PASS types.includes("text/html") is true
PASS items.some((item) => item.kind == "string" && item.type == "text/html") is true
PASS successfullyParsed is true
TEST COMPLETE