зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1374944 - rewrite mochitest-3 tests for using data: URI. r=smaug
This commit is contained in:
Родитель
e0674ba40d
Коммит
8ebd97f178
|
@ -0,0 +1 @@
|
||||||
|
<iframe id='f' style='position:absolute; border:none; width:100%; height:100%; left:0; top:0' srcdoc='<input>'>
|
|
@ -0,0 +1,3 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<div id="scrollbox" style="height: 100px; overflow: auto;">
|
||||||
|
<div style="height: 1000px;"></div></div>
|
|
@ -0,0 +1,3 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<div id="scrollbox" style="height: 100px; overflow: auto;">
|
||||||
|
<div style="height: 1000px;"></div> </div>
|
|
@ -5,6 +5,9 @@ support-files =
|
||||||
bug299673.js
|
bug299673.js
|
||||||
bug322588-popup.html
|
bug322588-popup.html
|
||||||
bug426082.html
|
bug426082.html
|
||||||
|
bug545268.html
|
||||||
|
bug574663.html
|
||||||
|
bug607464.html
|
||||||
bug656379-1.html
|
bug656379-1.html
|
||||||
bug418986-3.js
|
bug418986-3.js
|
||||||
error_event_worker.js
|
error_event_worker.js
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
<body><div id='target' style='width: 50px; height: 50px; background: green'></div></body>
|
|
@ -129,4 +129,6 @@ support-files =
|
||||||
pointerevent_touch-action-pan-right-css_touch-manual.html
|
pointerevent_touch-action-pan-right-css_touch-manual.html
|
||||||
pointerevent_touch-action-pan-up-css_touch-manual.html
|
pointerevent_touch-action-pan-up-css_touch-manual.html
|
||||||
[test_trigger_fullscreen_by_pointer_events.html]
|
[test_trigger_fullscreen_by_pointer_events.html]
|
||||||
|
support-files =
|
||||||
|
file_test_trigger_fullscreen.html
|
||||||
[test_trigger_popup_by_pointer_events.html]
|
[test_trigger_popup_by_pointer_events.html]
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
SimpleTest.waitForExplicitFinish();
|
SimpleTest.waitForExplicitFinish();
|
||||||
|
|
||||||
function startTest() {
|
function startTest() {
|
||||||
let win = window.open("data:text/html,<body><div id='target' style='width: 50px; height: 50px; background: green'></div></body>", "_blank");
|
let win = window.open("file_test_trigger_fullscreen.html", "_blank");
|
||||||
win.addEventListener("load", () => {
|
win.addEventListener("load", () => {
|
||||||
let target = win.document.getElementById("target");
|
let target = win.document.getElementById("target");
|
||||||
target.addEventListener("pointerdown", () => {
|
target.addEventListener("pointerdown", () => {
|
||||||
|
|
|
@ -132,7 +132,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=545268
|
||||||
|
|
||||||
SimpleTest.waitForExplicitFinish();
|
SimpleTest.waitForExplicitFinish();
|
||||||
SimpleTest.requestFlakyTimeout("untriaged");
|
SimpleTest.requestFlakyTimeout("untriaged");
|
||||||
win = window.open("data:text/html,<iframe id='f' style='position:absolute; border:none; width:100%; height:100%; left:0; top:0' src='data:text/html,<input>'>", "" , "");
|
win = window.open("bug545268.html", "" , "");
|
||||||
win.onload = doTest;
|
win.onload = doTest;
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -97,10 +97,7 @@ function sendTouchpadScrollMotion(scrollbox, direction, ctrl, momentum, callback
|
||||||
}
|
}
|
||||||
|
|
||||||
function runTest() {
|
function runTest() {
|
||||||
var win = open('data:text/html,<!DOCTYPE html>\n' +
|
var win = open('bug574663.html', '_blank', 'width=300,height=300');
|
||||||
'<div id="scrollbox" style="height: 100px; overflow: auto;">' +
|
|
||||||
' <div style="height: 1000px;"></div>' +
|
|
||||||
'</div>', '_blank', 'width=300,height=300');
|
|
||||||
SimpleTest.waitForFocus(function () {
|
SimpleTest.waitForFocus(function () {
|
||||||
var scrollbox = win.document.getElementById("scrollbox");
|
var scrollbox = win.document.getElementById("scrollbox");
|
||||||
let winUtils = SpecialPowers.getDOMWindowUtils(win);
|
let winUtils = SpecialPowers.getDOMWindowUtils(win);
|
||||||
|
|
|
@ -45,10 +45,7 @@ function scrollDown150PxWithPixelScrolling(scrollbox) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function runTest() {
|
function runTest() {
|
||||||
var win = open('data:text/html,<!DOCTYPE html>\n' +
|
var win = open('bug607464.html', '_blank', 'width=300,height=300');
|
||||||
'<div id="scrollbox" style="height: 100px; overflow: auto;">' +
|
|
||||||
' <div style="height: 1000px;"></div>' +
|
|
||||||
'</div>', '_blank', 'width=300,height=300');
|
|
||||||
SimpleTest.waitForFocus(function () {
|
SimpleTest.waitForFocus(function () {
|
||||||
var scrollbox = win.document.getElementById("scrollbox");
|
var scrollbox = win.document.getElementById("scrollbox");
|
||||||
let scrollTopBefore = scrollbox.scrollTop;
|
let scrollTopBefore = scrollbox.scrollTop;
|
||||||
|
|
|
@ -28,7 +28,7 @@ function runTest() {
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p id="text">Normal text</p>
|
<p id="text">Normal text</p>
|
||||||
<iframe src="data:text/plain,text in iframe"></iframe>
|
<iframe srcdoc="text in iframe"></iframe>
|
||||||
<p id="text2">Normal text</p>
|
<p id="text2">Normal text</p>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|
|
@ -24,7 +24,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=944011
|
||||||
ok(true, "Got onclick");
|
ok(true, "Got onclick");
|
||||||
SimpleTest.finish();
|
SimpleTest.finish();
|
||||||
}
|
}
|
||||||
$('ifr').setAttribute('src', 'data:text/html,<html><body>Second frame</body></html>');
|
$('ifr').setAttribute('srcdoc', '<html><body>Second frame</body></html>');
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
ok(true, "Got second load");
|
ok(true, "Got second load");
|
||||||
|
@ -43,7 +43,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=944011
|
||||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=944011">Mozilla Bug 944011</a>
|
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=944011">Mozilla Bug 944011</a>
|
||||||
<p id="display"></p>
|
<p id="display"></p>
|
||||||
<div id="content" style="display: none">
|
<div id="content" style="display: none">
|
||||||
<iframe id="ifr" onload="loaded();" src="data:text/html,<html><body>foo</body></html>"></iframe>
|
<iframe id="ifr" onload="loaded();" srcdoc="<html><body>foo</body></html>"></iframe>
|
||||||
<div name="testTarget"></div>
|
<div name="testTarget"></div>
|
||||||
</div>
|
</div>
|
||||||
<pre id="test">
|
<pre id="test">
|
||||||
|
|
|
@ -28,7 +28,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1007790
|
||||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1007790">Mozilla Bug 1007790</a>
|
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1007790">Mozilla Bug 1007790</a>
|
||||||
<p id="display"></p>
|
<p id="display"></p>
|
||||||
<div id="content" style="display: none" onerror="">
|
<div id="content" style="display: none" onerror="">
|
||||||
<iframe src="data:text/html,<body onerror=''>"></iframe>
|
<iframe srcdoc="<body onerror=''>"></iframe>
|
||||||
</div>
|
</div>
|
||||||
<pre id="test">
|
<pre id="test">
|
||||||
</pre>
|
</pre>
|
||||||
|
|
|
@ -10,7 +10,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=697636
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
<iframe id="f" src="data:text/html,<body text=green>1" allowfullscreen></iframe>
|
<iframe id="f" srcdoc="<body text=green>1" allowfullscreen></iframe>
|
||||||
|
|
||||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=697636">Mozilla Bug 697636</a>
|
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=697636">Mozilla Bug 697636</a>
|
||||||
<p id="display"></p>
|
<p id="display"></p>
|
||||||
|
@ -27,9 +27,10 @@ var e1;
|
||||||
|
|
||||||
function begin()
|
function begin()
|
||||||
{
|
{
|
||||||
frameWin = document.getElementById("f").contentWindow;
|
var f = document.getElementById("f");
|
||||||
|
frameWin = f.contentWindow;
|
||||||
e1 = frameWin.document.documentElement;
|
e1 = frameWin.document.documentElement;
|
||||||
frameWin.location = "data:text/html,<body text=blue onload='parent.b2()'>2";
|
f.srcdoc = "<body text=blue onload='parent.b2()'>2";
|
||||||
}
|
}
|
||||||
|
|
||||||
function b2()
|
function b2()
|
||||||
|
|
|
@ -10,7 +10,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=685402
|
||||||
</head>
|
</head>
|
||||||
<body style="background-color: gray;">
|
<body style="background-color: gray;">
|
||||||
|
|
||||||
<iframe id="f" src="data:text/html,<body text=green>1" allowfullscreen></iframe>
|
<iframe id="f" srcdoc="<body text=green>1" allowfullscreen></iframe>
|
||||||
|
|
||||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685402">Mozilla Bug 685402</a>
|
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685402">Mozilla Bug 685402</a>
|
||||||
<p id="display"></p>
|
<p id="display"></p>
|
||||||
|
@ -29,11 +29,12 @@ var prevTrusted;
|
||||||
|
|
||||||
function begin()
|
function begin()
|
||||||
{
|
{
|
||||||
frameWin = document.getElementById("f").contentWindow;
|
var f = document.getElementById("f");
|
||||||
|
frameWin = f.contentWindow;
|
||||||
e1 = frameWin.document.body;
|
e1 = frameWin.document.body;
|
||||||
document.addEventListener("fullscreenchange", function() {
|
document.addEventListener("fullscreenchange", function() {
|
||||||
opener.ok(document.fullscreenElement, "[navigation] Request should be granted");
|
opener.ok(document.fullscreenElement, "[navigation] Request should be granted");
|
||||||
frameWin.location = "data:text/html,<body text=blue onload='parent.b2()'>2";
|
f.srcdoc = "<body text=blue onload='parent.b2()'>2";
|
||||||
}, {once: true});
|
}, {once: true});
|
||||||
|
|
||||||
e1.requestFullscreen();
|
e1.requestFullscreen();
|
||||||
|
|
|
@ -26,7 +26,7 @@ Tests:
|
||||||
|
|
||||||
<div id="fse">
|
<div id="fse">
|
||||||
<div id="fse-inner">
|
<div id="fse-inner">
|
||||||
<iframe id="subdoc" allowfullscreen src="data:text/html,<html><body bgcolor='black'></body></html>"></iframe>
|
<iframe id="subdoc" allowfullscreen srcdoc="<html><body bgcolor='black'></body></html>"></iframe>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=802895
|
||||||
<iframe id="iframe1" src="about:mozilla"
|
<iframe id="iframe1" src="about:mozilla"
|
||||||
srcdoc="Goodbye World"></iframe>
|
srcdoc="Goodbye World"></iframe>
|
||||||
<iframe id="iframe2" srcdoc="Peeking test" sandbox=""></iframe>
|
<iframe id="iframe2" srcdoc="Peeking test" sandbox=""></iframe>
|
||||||
<iframe id="iframe3" src="data:text/html;charset=US-ASCII,Gone"
|
<iframe id="iframe3" src="file_srcdoc_iframe3.html"
|
||||||
srcdoc="Going"></iframe>
|
srcdoc="Going"></iframe>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
Gone
|
|
@ -169,6 +169,7 @@ support-files =
|
||||||
file_iframe_sandbox_worker.js
|
file_iframe_sandbox_worker.js
|
||||||
file_srcdoc-2.html
|
file_srcdoc-2.html
|
||||||
file_srcdoc.html
|
file_srcdoc.html
|
||||||
|
file_srcdoc_iframe3.html
|
||||||
file_window_open_close_outer.html
|
file_window_open_close_outer.html
|
||||||
file_window_open_close_inner.html
|
file_window_open_close_inner.html
|
||||||
formSubmission_chrome.js
|
formSubmission_chrome.js
|
||||||
|
|
|
@ -53,7 +53,7 @@ const ACTION_FUNCS = [
|
||||||
function navigate(win) {
|
function navigate(win) {
|
||||||
info("About to navigate to another page");
|
info("About to navigate to another page");
|
||||||
var deferred = new Deferred();
|
var deferred = new Deferred();
|
||||||
win.location = "data:text/html,<html>";
|
win.location = "dummy_page.html";
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
SimpleTest.waitForFocus(() => {
|
SimpleTest.waitForFocus(() => {
|
||||||
checkIsChromeFullscreen(win, false).then(() => {
|
checkIsChromeFullscreen(win, false).then(() => {
|
||||||
|
|
|
@ -84,7 +84,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=802895
|
||||||
// Test srcdoc attribute removal
|
// Test srcdoc attribute removal
|
||||||
iframe3.onload = function () {
|
iframe3.onload = function () {
|
||||||
var innerDoc3 = iframe3.contentDocument;
|
var innerDoc3 = iframe3.contentDocument;
|
||||||
is(innerDoc3.body.innerHTML, "Gone", "Bad srcdoc attribute removal");
|
is(innerDoc3.body.innerText, "Gone", "Bad srcdoc attribute removal");
|
||||||
finish3 = true;
|
finish3 = true;
|
||||||
if (finish && finish1 && finish3) {
|
if (finish && finish1 && finish3) {
|
||||||
SimpleTest.finish();
|
SimpleTest.finish();
|
||||||
|
|
Загрузка…
Ссылка в новой задаче