mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-15 14:25:52 +00:00
Modified test for bug 396024, this should not cause test failures when no printer is installed
This commit is contained in:
parent
720992b3c1
commit
7625e6aa63
@ -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 \
|
||||
|
@ -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,8 +52,11 @@ function exitprintpreview() {
|
||||
function run()
|
||||
{
|
||||
/** Test for Bug 396024 **/
|
||||
window.frames[0].frameElement.setAttribute('onload', 'run2()');
|
||||
netscape.security.PrivilegeManager.enablePrivilege('UniversalPreferencesRead UniversalPreferencesWrite UniversalXPConnect');
|
||||
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");
|
||||
@ -62,6 +64,9 @@ function run()
|
||||
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() {
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user