From 14126e8fd649c11bae84e088694f8241ba816fc6 Mon Sep 17 00:00:00 2001 From: "L. David Baron" Date: Sat, 8 Nov 2008 08:35:54 -0800 Subject: [PATCH] Make about:blank work correctly as a reference for reftests served over HTTP. (Bug 457821) r=jwalden --- layout/reftests/reftest-sanity/blank.html | 5 +++++ layout/reftests/reftest-sanity/reftest.list | 13 +++++++++++++ layout/tools/reftest/reftest.js | 10 +++++++--- 3 files changed, 25 insertions(+), 3 deletions(-) create mode 100644 layout/reftests/reftest-sanity/blank.html diff --git a/layout/reftests/reftest-sanity/blank.html b/layout/reftests/reftest-sanity/blank.html new file mode 100644 index 00000000000..eaca3f49fd1 --- /dev/null +++ b/layout/reftests/reftest-sanity/blank.html @@ -0,0 +1,5 @@ + + + + + diff --git a/layout/reftests/reftest-sanity/reftest.list b/layout/reftests/reftest-sanity/reftest.list index a16a9f54095..cff652df07f 100644 --- a/layout/reftests/reftest-sanity/reftest.list +++ b/layout/reftests/reftest-sanity/reftest.list @@ -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,
Text
+== data:text/html,
Text
default.html +HTTP == default.html data:text/html,
Text
+HTTP == data:text/html,
Text
default.html +!= blank.html default.html +HTTP != blank.html default.html diff --git a/layout/tools/reftest/reftest.js b/layout/tools/reftest/reftest.js index d6f00e64814..f1c00303617 100644 --- a/layout/tools/reftest/reftest.js +++ b/layout/tools/reftest/reftest.js @@ -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,