Bug 1363612 - Part 1: move to seperate files. r=smaug

This commit is contained in:
Yoshi Huang 2017-05-10 10:40:41 +08:00
Родитель 13715ecf38
Коммит 9af1bdc477
49 изменённых файлов: 93 добавлений и 33 удалений

Просмотреть файл

@ -0,0 +1 @@
<script>opener.setTimeout(opener.basicOpenerTest, 0, this)</script>

Просмотреть файл

@ -0,0 +1 @@
<script>opener.setTimeout(opener.continueOpenerTest, 0, this);</script>

Просмотреть файл

@ -0,0 +1 @@
<script>opener.setTimeout(opener.continueOpenerTest2, 0, this);</script>

Просмотреть файл

@ -0,0 +1 @@
Loaded

Просмотреть файл

@ -1,7 +1,8 @@
<html><head> <html><head>
<title>Bug 426646, Using location.replace breaks iframe history</title> <title>Bug 426646, Using location.replace breaks iframe history</title>
<script type="text/javascript"> <script type="text/javascript">
var url1 = "data:text/html;charset=utf-8,1st%20page"; var BASE_URI = "http://mochi.test:8888/tests/dom/base/test/";
var url1 = BASE_URI + "iframe1_bug426646.html";
function soon(f) { function soon(f) {
return function() { setTimeout(f, 0); }; return function() { setTimeout(f, 0); };
@ -15,7 +16,7 @@ function doe() {
} }
function doe2() { function doe2() {
window.frames[0].location = 'data:text/html;charset=utf-8,2nd%20page'; window.frames[0].location = 'iframe2_bug426646.html';
window.frames[0].frameElement.onload = soon(doe3); window.frames[0].frameElement.onload = soon(doe3);
} }

Просмотреть файл

@ -1,7 +1,8 @@
<html><head> <html><head>
<title>Bug 426646, Using location.replace breaks iframe history</title> <title>Bug 426646, Using location.replace breaks iframe history</title>
<script type="text/javascript"> <script type="text/javascript">
var url1 = "data:text/html;charset=utf-8,1st%20page"; var BASE_URI = "http://mochi.test:8888/tests/dom/base/test/";
var url1 = BASE_URI + "iframe1_bug426646.html";
var win0 = null; var win0 = null;
@ -46,7 +47,7 @@ function doe3() {
} }
win0.frameElement.onload = soon(doe4); win0.frameElement.onload = soon(doe4);
win0.location = 'data:text/html;charset=utf-8,2nd%20page'; win0.location = BASE_URI + 'iframe2_bug426646.html';
} }
function doe4() { function doe4() {

Просмотреть файл

@ -0,0 +1 @@
<meta charset="utf-8"><script>parent.pass();</script>

Просмотреть файл

@ -0,0 +1 @@
<html><meta charset="utf-8">1st page</html>

Просмотреть файл

@ -0,0 +1 @@
<html><meta charset="utf-8">2nd page</html>

Просмотреть файл

@ -115,6 +115,7 @@ support-files =
file_bug707142_utf-16.json file_bug707142_utf-16.json
file_bug708620-2.html file_bug708620-2.html
file_bug708620.html file_bug708620.html
file_bug753278.html
file_bug769117.html file_bug769117.html
file_bug782342.txt file_bug782342.txt
file_bug787778.sjs file_bug787778.sjs
@ -237,6 +238,12 @@ support-files =
iframe5_bug431701.xml iframe5_bug431701.xml
iframe6_bug431701.xml iframe6_bug431701.xml
iframe7_bug431701.xml iframe7_bug431701.xml
iframe1_bug426646.html
iframe2_bug426646.html
file1_setting_opener.html
file2_setting_opener.html
file3_setting_opener.html
file4_setting_opener.html
[test_anchor_area_referrer.html] [test_anchor_area_referrer.html]
[test_anchor_area_referrer_changing.html] [test_anchor_area_referrer_changing.html]

Просмотреть файл

@ -26,7 +26,7 @@ var f = document.getElementsByTagName("iframe")[0];
function runTest() { function runTest() {
f.contentDocument.open(); f.contentDocument.open();
f.contentDocument.write('<script>window.location = "data:text/html;charset=utf-8,\\u003Cscript>parent.pass();\\u003C/script>"; document.close(); document.open(); document.write("\\u003Cscript>parent.fail();\\u003C/script>"); document.close();\u003c/script>'); f.contentDocument.write('<script>window.location = "file_bug753278.html"; document.close(); document.open(); document.write("\\u003Cscript>parent.fail();\\u003C/script>"); document.close();\u003c/script>');
f.contentDocument.close(); f.contentDocument.close();
} }

Просмотреть файл

@ -18,7 +18,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=868996
function testOpenerSet() { function testOpenerSet() {
// Use setTimeout to make the relevant onerror run in this window // Use setTimeout to make the relevant onerror run in this window
var win = window.open("data:text/html,<script>opener.setTimeout(opener.basicOpenerTest, 0, this)</" + "script>"); var win = window.open("file1_setting_opener.html");
// A sandbox for the window // A sandbox for the window
sb1 = new Cu.Sandbox(win, {wantXrays: true }) sb1 = new Cu.Sandbox(win, {wantXrays: true })
sb1.win = win sb1.win = win
@ -49,7 +49,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=868996
is(evalsb("win.opener", sb2), $("z").contentWindow, is(evalsb("win.opener", sb2), $("z").contentWindow,
"Should be able to set the opener to a different window in a sandbox two"); "Should be able to set the opener to a different window in a sandbox two");
win.location = "data:text/html,<script>opener.setTimeout(opener.continueOpenerTest, 0, this);</" + "script>"; win.location = "file2_setting_opener.html";
} }
function continueOpenerTest(win) { function continueOpenerTest(win) {
@ -67,7 +67,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=868996
"Should be able to set the opener to a primitive in a sandbox one"); "Should be able to set the opener to a primitive in a sandbox one");
is(evalsb("win.opener", sb2), 5, is(evalsb("win.opener", sb2), 5,
"Should be able to set the opener to a primitive in a sandbox two"); "Should be able to set the opener to a primitive in a sandbox two");
win.location = "data:text/html,<script>opener.setTimeout(opener.continueOpenerTest2, 0, this);</" + "script>"; win.location = "file3_setting_opener.html";
} }
function continueOpenerTest2(win) { function continueOpenerTest2(win) {
@ -85,7 +85,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=868996
is(evalsb("win.opener", sb2), null, is(evalsb("win.opener", sb2), null,
"Setting the opener to null should be visible in sb2"); "Setting the opener to null should be visible in sb2");
win.location = "data:text/html,Loaded"; win.location = "file4_setting_opener.html";
// Now poll for that load, since we have no way for the window to // Now poll for that load, since we have no way for the window to
// communicate with us now // communicate with us now
setTimeout(checkForLoad, 0, win); setTimeout(checkForLoad, 0, win);
@ -93,7 +93,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=868996
function checkForLoad(win) { function checkForLoad(win) {
if (!win.document.documentElement || if (!win.document.documentElement ||
win.document.documentElement.textContent != "Loaded") { win.document.documentElement.innerText != "Loaded") {
setTimeout(checkForLoad, 0, win); setTimeout(checkForLoad, 0, win);
return; return;
} }

Просмотреть файл

@ -9,6 +9,8 @@ support-files =
file_mozbrowser2.html file_mozbrowser2.html
iframe_mozbrowser.html iframe_mozbrowser.html
iframe_mozbrowser2.html iframe_mozbrowser2.html
testUrl1_bfcache.html
testUrl2_bfcache.html
[test_broadcastchannel_any.html] [test_broadcastchannel_any.html]
[test_broadcastchannel_basic.html] [test_broadcastchannel_basic.html]

Просмотреть файл

@ -0,0 +1 @@
<script>onpageshow = function(e) { opener.page1Shown(e); };</script>

Просмотреть файл

@ -0,0 +1 @@
<script>onpageshow = function(e) { opener.page2Shown(e); };</script>

Просмотреть файл

@ -25,8 +25,8 @@
* when testUrl2 was shown, we want event.persisted be false, otherwise * when testUrl2 was shown, we want event.persisted be false, otherwise
* true. * true.
*/ */
var testUrl1 = "data:text/html,<script>onpageshow = function(e) { opener.page1Shown(e); };<" + "/script>"; var testUrl1 = "testUrl1_bfcache.html";
var testUrl2 = "data:text/html,<script>onpageshow = function(e) { opener.page2Shown(e); };<" + "/script>"; var testUrl2 = "testUrl2_bfcache.html";
var testWin; var testWin;
var counter = 0; var counter = 0;

Просмотреть файл

@ -0,0 +1 @@
<html><body onload='close(); opener.result0 = 1;'>

Просмотреть файл

@ -0,0 +1 @@
<html><body onload='close(); returnValue = 1;' /></html>

Просмотреть файл

@ -0,0 +1 @@
<html><body onload='close(); opener.result2 = 2;'>

Просмотреть файл

@ -0,0 +1 @@
<html><body onload='close(); returnValue = 1;' /></html>

Просмотреть файл

@ -0,0 +1 @@
<html><body onload="opener.is(window.dialogArguments, 'my args', 'subsequent dialog document did not get the right arguments.'); close();"></html>

Просмотреть файл

@ -0,0 +1 @@
<html><body onload='close(); returnValue = 3;'>

Просмотреть файл

@ -9,7 +9,7 @@ if (location.toString().match(/^http:\/\/mochi.test:8888/)) {
"dialog did not get the right arguments."); "dialog did not get the right arguments.");
// Load a different url, and test that it sees the arguments (since it's same origin). // Load a different url, and test that it sees the arguments (since it's same origin).
window.location="data:text/html,<html><body onload=\"opener.is(window.dialogArguments, 'my args', 'subsequent dialog document did not get the right arguments.'); close();\">';"; window.location="file2_bug504862.html";
} else { } else {
// Post a message containing our arguments to the opener to test // Post a message containing our arguments to the opener to test
// that this cross origing dialog does *not* see the passed in // that this cross origing dialog does *not* see the passed in

Просмотреть файл

@ -13,6 +13,7 @@ support-files =
file_bug291653.html file_bug291653.html
file_bug406375.html file_bug406375.html
file_bug504862.html file_bug504862.html
file2_bug504862.html
file_bug593174_1.html file_bug593174_1.html
file_bug593174_2.html file_bug593174_2.html
file_bug809290_b1.html file_bug809290_b1.html
@ -37,6 +38,15 @@ support-files =
file_cookieOutputter.html file_cookieOutputter.html
file_redirector.sjs file_redirector.sjs
file_prime_cookie.html file_prime_cookie.html
test1_bug369306.html
test2_bug369306.html
test1_bug622361.html
test2_bug622361.html
file1_bug414291.html
file2_bug414291.html
file3_bug414291.html
file1_bug437361.html
file2_bug437361.html
[test_DOMWindowCreated_chromeonly.html] [test_DOMWindowCreated_chromeonly.html]
[test_bug132255.html] [test_bug132255.html]

Просмотреть файл

@ -0,0 +1 @@
<script>opener.focus();</script>

Просмотреть файл

@ -0,0 +1 @@
1

Просмотреть файл

@ -0,0 +1 @@
<script>blur();</script>

Просмотреть файл

@ -0,0 +1 @@
2

Просмотреть файл

@ -89,12 +89,12 @@ function test2()
function test3() function test3()
{ {
focusShouldNotChange2("data:text/html,\<script>opener.focus();\<\/script>", test4); focusShouldNotChange2("test1_bug369306.html", test4);
} }
function test4() function test4()
{ {
focusShouldNotChange2("data:text/html,\<script>blur();\<\/script>", test5); focusShouldNotChange2("test2_bug369306.html", test5);
} }
function test5() function test5()

Просмотреть файл

@ -18,14 +18,14 @@ var result1 = 0;
var result2 = 0; var result2 = 0;
var result3 = 0; var result3 = 0;
window.open("data:text/html,<html><body onload='close(); opener.result1 = 1;'>", "w1"); window.open("file1_bug414291.html", "w1");
is(result1, 0, "window should not be opened either as modal or loaded synchronously."); is(result1, 0, "window should not be opened either as modal or loaded synchronously.");
window.open("data:text/html,<html><body onload='close(); opener.result2 = 2;'>", "w2", "modal=yes"); window.open("file2_bug414291.html", "w2", "modal=yes");
is(result2, 0, "window should not be opened either as modal or data loaded synchronously."); is(result2, 0, "window should not be opened either as modal or data loaded synchronously.");
if (window.showModalDialog) { if (window.showModalDialog) {
result3 = window.showModalDialog("data:text/html,<html><body onload='close(); returnValue = 3;'>"); result3 = window.showModalDialog("file3_bug414291.html");
is(result3, 3, "window should be opened as modal."); is(result3, 3, "window should be opened as modal.");
} }

Просмотреть файл

@ -15,14 +15,14 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=437361
function testModalDialogBlockedCleanly() { function testModalDialogBlockedCleanly() {
is(true, SpecialPowers.getBoolPref("dom.disable_open_during_load"), "mozprefs sanity check"); is(true, SpecialPowers.getBoolPref("dom.disable_open_during_load"), "mozprefs sanity check");
var rv = window.showModalDialog( // should be blocked without exception var rv = window.showModalDialog( // should be blocked without exception
"data:text/html,<html><body onload='close(); returnValue = 1;' /></html>"); "file1_bug437361.html");
is(rv, null, "Modal dialog opened unexpectedly."); is(rv, null, "Modal dialog opened unexpectedly.");
} }
function testModalDialogAllowed() { function testModalDialogAllowed() {
is(false, SpecialPowers.getBoolPref("dom.disable_open_during_load"), "mozprefs sanity check"); is(false, SpecialPowers.getBoolPref("dom.disable_open_during_load"), "mozprefs sanity check");
var rv = window.showModalDialog( // should not be blocked this time var rv = window.showModalDialog( // should not be blocked this time
"data:text/html,<html><body onload='close(); returnValue = 1;' /></html>"); "file2_bug437361.html");
is(rv, 1, "Problem with modal dialog returnValue."); is(rv, 1, "Problem with modal dialog returnValue.");
} }

Просмотреть файл

@ -19,11 +19,11 @@ function boom(event)
switch (counter) switch (counter)
{ {
case 1: case 1:
w = window.open("data:text/html,1"); w = window.open("test1_bug622361.html");
doNext(); doNext();
return; return;
case 2: case 2:
w.location = "data:text/html,2"; w.location = "test2_bug622361.html";
function next() function next()
{ {
w.history.back(); w.history.back();

Просмотреть файл

@ -38,7 +38,7 @@ var innerWidthMax = (isWin8 ? 125 : 100);
var isExecuted = false; var isExecuted = false;
function test() { function test() {
var w = window.open('data:text/html,null', null, 'width=300,height=300'); var w = window.open('file_empty.html', null, 'width=300,height=300');
SimpleTest.waitForFocus(function() { SimpleTest.waitForFocus(function() {
w.onresize = function() { w.onresize = function() {

Просмотреть файл

@ -0,0 +1 @@
1

Просмотреть файл

@ -0,0 +1 @@
2

Просмотреть файл

@ -0,0 +1 @@
3

Просмотреть файл

@ -6,6 +6,9 @@ support-files =
framed_location.html framed_location.html
idn_child.html idn_child.html
innerWidthHeight_script.html innerWidthHeight_script.html
iframe1_location_setters.html
iframe2_location_setters.html
iframe3_location_setters.html
[test_crossdomainprops.html] [test_crossdomainprops.html]
[test_innerWidthHeight_script.html] [test_innerWidthHeight_script.html]

Просмотреть файл

@ -22,12 +22,13 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=639720
/** Test for Bug 639720 **/ /** Test for Bug 639720 **/
SimpleTest.waitForExplicitFinish(); SimpleTest.waitForExplicitFinish();
var BASE_URI = "http://mochi.test:8888/tests/dom/tests/mochitest/dom-level0/";
var tests = [ var tests = [
{ url: "data:text/plain,1" }, { url: BASE_URI + "iframe1_location_setters.html" },
{ url: "data:text/plain,2", { url: BASE_URI + "iframe2_location_setters.html",
useDocument: true }, useDocument: true },
{ prepURL: "http://www.example.com", { prepURL: "http://www.example.com",
url: "data:text/plain,3" } url: BASE_URI + "iframe3_location_setters.html" }
]; ];
var currentTest = 0; var currentTest = 0;

Просмотреть файл

@ -9,7 +9,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=602256
<body onload="SimpleTest.executeSoon(run_test)"> <body onload="SimpleTest.executeSoon(run_test)">
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=602256">Mozilla Bug 602256</a> <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=602256">Mozilla Bug 602256</a>
<div id="content"> <div id="content">
<iframe id="iframe" src="data:text/html,<p%20id='text'>Start</p>"></iframe> <iframe id="iframe" src="start_historyframe.html"></iframe>
</div> </div>
<pre id="test"> <pre id="test">
<script type="application/javascript"> <script type="application/javascript">
@ -52,9 +52,10 @@ function getContent() {
return gFrame.contentDocument.getElementById("text").textContent; return gFrame.contentDocument.getElementById("text").textContent;
} }
var START = "data:text/html,<p%20id='text'>Start</p>"; var BASE_URI = "http://mochi.test:8888/tests/dom/tests/mochitest/general/";
var URL1 = "data:text/html,<p%20id='text'>Test1</p>"; var START = BASE_URI + "start_historyframe.html";
var URL2 = "data:text/html,<p%20id='text'>Test2</p>"; var URL1 = BASE_URI + "url1_historyframe.html";
var URL2 = BASE_URI + "url2_historyframe.html";
function run_test() { function run_test() {
window.history.pushState("START", window.location); window.history.pushState("START", window.location);

Просмотреть файл

@ -11,6 +11,9 @@ support-files =
file_moving_xhr.html file_moving_xhr.html
file_showModalDialog.html file_showModalDialog.html
historyframes.html historyframes.html
start_historyframe.html
url1_historyframe.html
url2_historyframe.html
image_50.png image_50.png
image_100.png image_100.png
image_200.png image_200.png

Просмотреть файл

@ -0,0 +1 @@
<p id='text'>Start</p>

Просмотреть файл

@ -0,0 +1 @@
<p id='text'>Test1</p>

Просмотреть файл

@ -0,0 +1 @@
<p id='text'>Test2</p>

Просмотреть файл

@ -0,0 +1 @@
<body onload='window.opener.loadDone()'>

Просмотреть файл

@ -1,6 +1,7 @@
[DEFAULT] [DEFAULT]
support-files = support-files =
bug310107-resource.xhtml bug310107-resource.xhtml
file_bug310107.html
file_bug372769.xhtml file_bug372769.xhtml
file_bug379959_cross.html file_bug379959_cross.html
file_bug379959_data.html file_bug379959_data.html
@ -39,4 +40,4 @@ support-files =
[test_bug872273.xhtml] [test_bug872273.xhtml]
[test_bug1086996.xhtml] [test_bug1086996.xhtml]
[test_bug1098628_throw_from_construct.xhtml] [test_bug1098628_throw_from_construct.xhtml]
[test_bug1359859.xhtml] [test_bug1359859.xhtml]

Просмотреть файл

@ -26,7 +26,7 @@ function runTest() {
window.doc = win.document; window.doc = win.document;
is(window.el.prop, 2, "Unexpected prop value at load"); is(window.el.prop, 2, "Unexpected prop value at load");
win.location = "data:text/html,<body onload='window.opener.loadDone()'>"; win.location = "file_bug310107.html";
} }
function loadDone() { function loadDone() {

Просмотреть файл

@ -0,0 +1,2 @@
<?xml version="1.0"?>
<root/>

Просмотреть файл

@ -3,6 +3,7 @@ support-files =
file_bug293347.xml file_bug293347.xml
file_bug293347xslt.xml file_bug293347xslt.xml
file_bug392338.js file_bug392338.js
file_bug691215.xml
[test_bug232004.xhtml] [test_bug232004.xhtml]
[test_bug293347.html] [test_bug293347.html]

Просмотреть файл

@ -21,7 +21,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=691215
SimpleTest.waitForExplicitFinish(); SimpleTest.waitForExplicitFinish();
var url = "data:text/xml,<root/>"; var BASE_URI = "http://mochi.test:8888/tests/dom/xml/test/";
var url = BASE_URI + "file_bug691215.xml";
var w; var w;
addLoadEvent(function() { addLoadEvent(function() {