diff --git a/layout/base/tests/Makefile.in b/layout/base/tests/Makefile.in index 2bcc755740b7..048b497d3c06 100644 --- a/layout/base/tests/Makefile.in +++ b/layout/base/tests/Makefile.in @@ -83,6 +83,7 @@ ifdef MOZ_MOCHITEST _TEST_FILES = \ test_bug66619.html \ test_bug388019.html \ + test_bug396024.html \ test_bug399284.html \ test_bug399951.html \ test_bug404209.xhtml \ diff --git a/layout/base/tests/test_bug396024.html b/layout/base/tests/test_bug396024.html index 0889da30b5f9..1e73792af1a3 100755 --- a/layout/base/tests/test_bug396024.html +++ b/layout/base/tests/test_bug396024.html @@ -38,7 +38,6 @@ function printpreview() { .getService(Components.interfaces.nsIPrefBranch); prefs.setBoolPref('print.show_print_progress', false); //XXX I would have thought this would work, instead I'm forced to use prefs service - // I'm disabling showPrintProgress dialog, because it stays as a zombie dialog, see bug 405588 gWbp.globalPrintSettings.showPrintProgress = false; gWbp.printPreview(gWbp.globalPrintSettings, null, listener); prefs.clearUserPref('print.show_print_progress'); @@ -53,15 +52,21 @@ function exitprintpreview() { function run() { /** Test for Bug 396024 **/ - window.frames[0].frameElement.setAttribute('onload', 'run2()'); netscape.security.PrivilegeManager.enablePrivilege('UniversalPreferencesRead UniversalPreferencesWrite UniversalXPConnect'); - SimpleTest.waitForExplicitFinish(); - printpreview(); - ok(gWbp.doingPrintPreview, "Should be doing print preview"); - exitprintpreview(); - ok(!gWbp.doingPrintPreview, "Should not be doing print preview anymore1"); - printpreview(); - window.frames[0].location.reload(); + var printService = Components.classes["@mozilla.org/gfx/printsettings-service;1"] + .getService(Components.interfaces.nsIPrintSettingsService); + if (printService.defaultPrinterName != '') { + window.frames[0].frameElement.setAttribute('onload', 'run2()'); + SimpleTest.waitForExplicitFinish(); + printpreview(); + ok(gWbp.doingPrintPreview, "Should be doing print preview"); + exitprintpreview(); + ok(!gWbp.doingPrintPreview, "Should not be doing print preview anymore1"); + printpreview(); + window.frames[0].location.reload(); + } else { + todo(false, "No printer seems installed on this machine, that is necessary for this test") + } } function run2() { @@ -88,4 +93,3 @@ function run2() { -