Bug 1308969 - Fix cross-origin browser name test, r=Ms2ger

MozReview-Commit-ID: 49stqMka8j5
This commit is contained in:
James Graham 2017-02-17 08:06:34 +00:00
Родитель 9ebabb921e
Коммит 190a5fa6c7
4 изменённых файлов: 51 добавлений и 47 удалений

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

@ -44239,6 +44239,11 @@
{} {}
] ]
], ],
"html/browsers/browsing-the-web/history-traversal/browsing_context_name_cross_origin-0.html": [
[
{}
]
],
"html/browsers/browsing-the-web/history-traversal/contains.json": [ "html/browsers/browsing-the-web/history-traversal/contains.json": [
[ [
{} {}
@ -164967,8 +164972,12 @@
"87d7d141b05200ad3db0660d9d8d8bdf7876ee4b", "87d7d141b05200ad3db0660d9d8d8bdf7876ee4b",
"testharness" "testharness"
], ],
"html/browsers/browsing-the-web/history-traversal/browsing_context_name_cross_origin-0.html": [
"a0512a75c277b22bbbcd37692580c779334ab74b",
"support"
],
"html/browsers/browsing-the-web/history-traversal/browsing_context_name_cross_origin.html": [ "html/browsers/browsing-the-web/history-traversal/browsing_context_name_cross_origin.html": [
"7455a083f29518418a3508b8fd3ade74cb747666", "80ddf5ab19d6698340820c2fa4145d4aa6960459",
"testharness" "testharness"
], ],
"html/browsers/browsing-the-web/history-traversal/browsing_context_name_cross_origin_2.html": [ "html/browsers/browsing-the-web/history-traversal/browsing_context_name_cross_origin_2.html": [

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

@ -1,15 +1,4 @@
[browsing_context_name_cross_origin.html] [browsing_context_name_cross_origin.html]
type: testharness type: testharness
[Restoring window.name on cross-origin history traversal] [Restoring window.name on cross-origin history traversal]
expected: expected: FAIL
if not debug and e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86_64") and (bits == 64): FAIL
if not debug and e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86") and (bits == 32): FAIL
if not debug and e10s and (os == "mac") and (version == "OS X 10.10.5") and (processor == "x86_64") and (bits == 64): FAIL
if not debug and e10s and (os == "win") and (version == "6.1.7601") and (processor == "x86") and (bits == 32): FAIL
if debug and e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86_64") and (bits == 64): FAIL
if debug and e10s and (os == "mac") and (version == "OS X 10.10.5") and (processor == "x86_64") and (bits == 64): FAIL
if debug and e10s and (os == "win") and (version == "6.2.9200") and (processor == "x86_64") and (bits == 64): FAIL
if debug and e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86") and (bits == 32): FAIL
if not debug and e10s and (os == "win") and (version == "6.2.9200") and (processor == "x86_64") and (bits == 64): FAIL
if debug and e10s and (os == "win") and (version == "6.1.7601") and (processor == "x86") and (bits == 32): FAIL

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

@ -0,0 +1,34 @@
<iframe id="test"></iframe>
<script>
var t = opener.t;
var f = document.getElementById("test");
var l = opener.document.getElementById("step_log");
var log = function(t) {l.textContent += ("\n" + t)}
var navigated = false;
var steps = [
() => f.src = "browsing_context_name-1.html",
() => {
navigated = true;
opener.assert_equals(f.contentWindow.name, "test", "Initial load");
f.src = f.src.replace("http://", "http://www.").replace("browsing_context_name-1", "browsing_context_name-2");
},
() => {
// Can't test .name easily here because it's cross-origin
opener.assert_equals(history.length, 2);
history.back()
},
() => {
opener.assert_equals(f.contentWindow.name, "test", "After navigation");
t.done();
}
].map((x, i) => t.step_func(() => {log("Step " + (i+1)); x()}));
next = () => steps.shift()();
onload = () => {
log("page load");
f.onload = () => {log("iframe onload"); next()};
setTimeout(next, 0);
};
</script>

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

@ -2,40 +2,12 @@
<title>Restoring window.name on cross-origin history traversal</title> <title>Restoring window.name on cross-origin history traversal</title>
<script src="/resources/testharness.js"></script> <script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script> <script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<pre id="step_log"></pre> <pre id="step_log"></pre>
<iframe id="test"></iframe>
<script> <script>
var t = async_test();
var t = async_test(undefined, {timeout:10000}); t.step(() => {
var f = document.getElementById("test"); var win = window.open("browsing_context_name_cross_origin-0.html");
var l = document.getElementById("step_log"); t.add_cleanup(() => win.close());
var navigated = false; });
log = function(t) {l.textContent += ("\n" + t)}
var steps = [
function() {f.src = "browsing_context_name-1.html"},
function() {
navigated = true;
assert_equals(f.contentWindow.name, "test", "Initial load");
setTimeout(next, 0);
},
function() {f.src = f.src.replace("http://", "http://www.").replace("browsing_context_name-1", "browsing_context_name-2");},
function() {
setTimeout(next, 0);
},
function() {history.back(); setTimeout(next, 500)},
function() {
assert_equals(f.contentWindow.name, "test", "After navigation");
t.done();
}
].map(function(x) {return t.step_func(function() {log("Step " + step); x()})});
var step = 0;
next = t.step_func(function() {steps[step++]()});
f.onload=next;
onload = function() { setTimeout(next, 0); };
</script> </script>