Fix up recently-landed test for async and target changes to postMessage. r=orange

This commit is contained in:
jwalden%mit.edu 2008-05-02 21:39:06 +00:00
Родитель 9a263e14dc
Коммит d460f58bec
3 изменённых файлов: 51 добавлений и 46 удалений

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

@ -1,25 +1,25 @@
<!DOCTYPE HTML>
<html>
<head>
<style>
#div1 {
color: green;
-moz-binding: url(file_bug379959_xbl.xml#xbltest);
}
#div2 {
color: green;
-moz-binding: url(http://example.com/tests/content/xbl/test/file_bug379959_xbl.xml#xbltest);
}
</style>
<body>
<div id="div1"></div>
<div id="div2"></div>
<script>
onload = function() {
nodes = document.getAnonymousNodes(document.getElementById('div1'));
parent.postMessage(nodes ? nodes.length : 0);
nodes = document.getAnonymousNodes(document.getElementById('div2'));
parent.postMessage(nodes ? nodes.length : 0);
}
</script>
</html>
<!DOCTYPE HTML>
<html>
<head>
<style>
#div1 {
color: green;
-moz-binding: url(file_bug379959_xbl.xml#xbltest);
}
#div2 {
color: green;
-moz-binding: url(http://example.com/tests/content/xbl/test/file_bug379959_xbl.xml#xbltest);
}
</style>
<body>
<div id="div1"></div>
<div id="div2"></div>
<script>
onload = function() {
nodes = document.getAnonymousNodes(document.getElementById('div1'));
parent.postMessage(nodes ? nodes.length : 0, "http://localhost:8888");
nodes = document.getAnonymousNodes(document.getElementById('div2'));
parent.postMessage(nodes ? nodes.length : 0, "http://localhost:8888");
}
</script>
</html>

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

@ -1,18 +1,18 @@
<!DOCTYPE HTML>
<html>
<head>
<style>
#d {
color: green;
-moz-binding: url(data:text/xml;charset=utf-8,%3C%3Fxml%20version%3D%221.0%22%3F%3E%0A%3Cbindings%20id%3D%22xbltestBindings%22%20xmlns%3D%22http%3A//www.mozilla.org/xbl%22%3E%0A%20%20%3Cbinding%20id%3D%22xbltest%22%3E%3Ccontent%3EPASS%3C/content%3E%3C/binding%3E%0A%3C/bindings%3E%0A);
}
</style>
<body>
<div id="d"></div>
<script>
onload = function() {
nodes = document.getAnonymousNodes(document.getElementById('d'));
parent.postMessage(nodes ? nodes.length : 0);
}
</script>
</html>
<!DOCTYPE HTML>
<html>
<head>
<style>
#d {
color: green;
-moz-binding: url(data:text/xml;charset=utf-8,%3C%3Fxml%20version%3D%221.0%22%3F%3E%0A%3Cbindings%20id%3D%22xbltestBindings%22%20xmlns%3D%22http%3A//www.mozilla.org/xbl%22%3E%0A%20%20%3Cbinding%20id%3D%22xbltest%22%3E%3Ccontent%3EPASS%3C/content%3E%3C/binding%3E%0A%3C/bindings%3E%0A);
}
</style>
<body>
<div id="d"></div>
<script>
onload = function() {
nodes = document.getAnonymousNodes(document.getElementById('d'));
parent.postMessage(nodes ? nodes.length : 0, "http://localhost:8888");
}
</script>
</html>

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

@ -27,9 +27,14 @@ SimpleTest.waitForExplicitFinish();
gen = runTest();
var messages = 0;
document.addEventListener("message",
function(e) { messages++; gen.send(e.data); },
false);
function receiveMessage(e)
{
is(e.origin, "http://localhost:8888", "wrong sender!");
messages++;
gen.send(e.data);
}
window.addEventListener("message", receiveMessage, false);
const prefName = "layout.debug.enable_data_xbl";