Make about:blank work correctly as a reference for reftests served over HTTP. (Bug 457821) r=jwalden

This commit is contained in:
L. David Baron 2008-11-08 08:35:54 -08:00
parent a1bf2f89c4
commit 14126e8fd6
3 changed files with 25 additions and 3 deletions

View File

@ -0,0 +1,5 @@
<!DOCTYPE html>
<html>
<body>
</body>
</html>

View File

@ -19,3 +19,16 @@ HTTP != html-vs-xhtml-by-extension.html html-vs-xhtml-by-extension.xhtml
!= green.html default.html
!= green.html red.html
!= red.html default.html
# Make sure about:blank works, even via HTTP.
== blank.html about:blank
== about:blank blank.html
HTTP == blank.html about:blank
HTTP == about:blank blank.html
# same for data:
== default.html data:text/html,<div>Text</div>
== data:text/html,<div>Text</div> default.html
HTTP == default.html data:text/html,<div>Text</div>
HTTP == data:text/html,<div>Text</div> default.html
!= blank.html default.html
HTTP != blank.html default.html

View File

@ -281,11 +281,15 @@ function ServeFiles(manifestURL, directory, files)
var secMan = CC[NS_SCRIPTSECURITYMANAGER_CONTRACTID]
.getService(CI.nsIScriptSecurityManager);
var testbase =
gIOService.newURI("http://localhost:" + HTTP_SERVER_PORT + path,
null, null);
function FileToURI(file)
{
var testURI = gIOService.newURI("http://localhost:" + HTTP_SERVER_PORT +
path + file,
null, null);
// Only serve relative URIs via the HTTP server, not absolute
// ones like about:blank.
var testURI = gIOService.newURI(file, null, testbase);
// XXX necessary? manifestURL guaranteed to be file, others always HTTP
secMan.checkLoadURI(manifestURL, testURI,