Index: chrome/content/tests/popupBlocker.js |
=================================================================== |
--- a/chrome/content/tests/popupBlocker.js |
+++ b/chrome/content/tests/popupBlocker.js |
@@ -12,43 +12,46 @@ |
server = new nsHttpServer(); |
server.start(1234); |
server.registerPathHandler("/test", function(metadata, response) |
{ |
response.setStatusLine("1.1", "200", "OK"); |
response.setHeader("Content-Type", "text/html; charset=utf-8"); |
- let body = '<html><body><a id="link" href="/redirect" target="_blank">link</a></body></html>'; |
+ let body = |
+ '<body onload="document.dispatchEvent(new CustomEvent(\'frameready\', {bubbles: true}));">' + |
+ '<a id="link" href="/redirect" target="_blank">link</a>' + |
+ '</body>'; |
response.bodyOutputStream.write(body, body.length); |
}); |
server.registerPathHandler("/redirect", function(metadata, response) |
{ |
response.setStatusLine("1.1", "302", "Moved Temporarily"); |
response.setHeader("Location", "http://127.0.0.1:1234/target"); |
}); |
server.registerPathHandler("/target", function(metadata, response) |
{ |
- response.setStatusLine("1.1", "302", "Moved Temporarily"); |
response.setHeader("Content-Type", "text/html; charset=utf-8"); |
let body = '<html><body>OK</body></html>'; |
response.bodyOutputStream.write(body, body.length); |
}); |
- frame = document.createElement("iframe"); |
+ frame = document.createElementNS("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul", "iframe"); |
+ frame.setAttribute("type", "content"); |
frame.setAttribute("src", "http://127.0.0.1:1234/test"); |
frame.style.visibility = "collapse"; |
document.body.appendChild(frame); |
stop(); |
- frame.addEventListener("load", function(event) |
+ frame.addEventListener("frameready", function(event) |
{ |
start(); |
- }, false); |
+ }, false, true); |
}, |
teardown: function() |
{ |
restoreFilterComponents.call(this); |
restorePrefs.call(this); |
stop(); |
server.stop(function() |