Bug 556644 - 4. Fix tests, r=bsmedberg a=blocking2.0

--HG--
rename : caps/tests/mochitest/test_bug292789.html => caps/tests/mochitest/test_bug292789.html.in
This commit is contained in:
Michael Wu 2010-08-10 15:18:40 -07:00
parent 953d3c4563
commit 2abb47c1f1
4 changed files with 16 additions and 2 deletions

View File

@ -51,5 +51,9 @@ _TEST_FILES = test_bug423375.html \
test_bug470804.html \
$(NULL)
test_bug292789.html : % : %.in
$(PYTHON) $(topsrcdir)/config/Preprocessor.py \
$(AUTOMATION_PPARGS) $(DEFINES) $(ACDEFINES) $< > $@
libs:: $(_TEST_FILES)
$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir)

View File

@ -38,7 +38,11 @@ function testScriptSrc(aCallback) {
** moved the resource
**/
var resjs = document.createElement("script");
#ifdef MOZ_CHROME_FILE_FORMAT_JAR
resjs.src = "jar:resource://gre/chrome/toolkit.jar!/content/mozapps/xpinstall/xpinstallConfirm.js";
#else
resjs.src = "resource://gre/chrome/toolkit/content/mozapps/xpinstall/xpinstallConfirm.js";
#endif
resjs.onload = scriptOnload;
document.getElementById("content").appendChild(resjs);
@ -55,7 +59,11 @@ function testScriptSrc(aCallback) {
/** <img src=""> tests **/
var img_global = "chrome://global/skin/icons/Error.png";
var img_mozapps = "chrome://mozapps/skin/passwordmgr/key.png";
#ifdef MOZ_CHROME_FILE_FORMAT_JAR
var res_mozapps = "jar:resource://gre/chrome/toolkit.jar!/skin/classic/mozapps/passwordmgr/key.png";
#else
var res_mozapps = "resource://gre/chrome/toolkit/skin/classic/mozapps/passwordmgr/key.png";
#endif
var imgTests = [[img_global, "success"],
[img_mozapps, "fail"],

View File

@ -67,13 +67,12 @@ function run_test() {
do_check_true(scope2.XPCOMUtils == scope.XPCOMUtils);
// try on a new object using a file URL
// try on a new object using the resolved URL
var res = Components.classes["@mozilla.org/network/protocol;1?name=resource"]
.getService(Components.interfaces.nsIResProtocolHandler);
var resURI = res.newURI("resource://gre/modules/XPCOMUtils.jsm", null, null);
dump("resURI: " + resURI + "\n");
var filePath = res.resolveURI(resURI);
do_check_eq(filePath.indexOf("file://"), 0);
var scope3 = {};
Components.utils.import(filePath, scope3);
do_check_eq(typeof(scope3.XPCOMUtils), "object");

View File

@ -526,6 +526,9 @@ GetExtension(nsILocalFile* file)
void
nsComponentManagerImpl::RegisterOmnijar(const char* aPath, bool aChromeOnly)
{
if (!mozilla::OmnijarPath())
return;
nsCOMPtr<nsIInputStream> is = mManifestLoader->LoadEntry(aPath);
PRUint32 flen;