зеркало из https://github.com/mozilla/gecko-dev.git
Clean up setting of preferences for reftest. (Bug 608030) r=roc a=blocking2.0:betaN+
This commit is contained in:
Родитель
51aff3c842
Коммит
177b2600d0
|
@ -92,11 +92,24 @@ RefTestCmdLineHandler.prototype =
|
|||
ios.manageOfflineStatus = false;
|
||||
ios.offline = false;
|
||||
|
||||
/* Force sRGB as an output profile for color management before we load a
|
||||
window. */
|
||||
/**
|
||||
* Manipulate preferences by adding to the *default* branch. Adding
|
||||
* to the default branch means the changes we make won't get written
|
||||
* back to user preferences.
|
||||
*
|
||||
* We want to do this here rather than in reftest.js because it's
|
||||
* important to force sRGB as an output profile for color management
|
||||
* before we load a window.
|
||||
*/
|
||||
var prefs = Components.classes["@mozilla.org/preferences-service;1"].
|
||||
getService(Components.interfaces.nsIPrefBranch2);
|
||||
prefs.setBoolPref("gfx.color_management.force_srgb", true);
|
||||
getService(Components.interfaces.nsIPrefService);
|
||||
var branch = prefs.getDefaultBranch("");
|
||||
branch.setBoolPref("gfx.color_management.force_srgb", true);
|
||||
branch.setBoolPref("browser.dom.window.dump.enabled", true);
|
||||
branch.setIntPref("ui.caretBlinkTime", -1);
|
||||
// no slow script dialogs
|
||||
branch.setIntPref("dom.max_script_run_time", 0);
|
||||
branch.setIntPref("dom.max_chrome_script_run_time", 0);
|
||||
|
||||
var wwatch = Components.classes["@mozilla.org/embedcomp/window-watcher;1"]
|
||||
.getService(nsIWindowWatcher);
|
||||
|
|
|
@ -359,11 +359,6 @@ function StartTests()
|
|||
|
||||
function OnRefTestUnload()
|
||||
{
|
||||
/* Clear the sRGB forcing pref to leave the profile as we found it. */
|
||||
var prefs = Components.classes["@mozilla.org/preferences-service;1"].
|
||||
getService(Components.interfaces.nsIPrefBranch2);
|
||||
prefs.clearUserPref("gfx.color_management.force_srgb");
|
||||
|
||||
gBrowser.removeEventListener("load", OnDocumentLoad, true);
|
||||
MozillaFileLogger.close();
|
||||
}
|
||||
|
|
|
@ -71,12 +71,11 @@ class RefTest(object):
|
|||
self.automation.setupPermissionsDatabase(profileDir,
|
||||
{'allowXULXBL': [('localhost', True), ('<file>', True)]})
|
||||
|
||||
# Set preferences.
|
||||
# Set preferences for communication between our command line arguments
|
||||
# and the reftest harness. Preferences that are required for reftest
|
||||
# to work should instead be set in reftest-cmdline.js .
|
||||
prefsFile = open(os.path.join(profileDir, "user.js"), "w")
|
||||
prefsFile.write("""user_pref("browser.dom.window.dump.enabled", true);
|
||||
""")
|
||||
prefsFile.write('user_pref("reftest.timeout", %d);\n' % (options.timeout * 1000))
|
||||
prefsFile.write('user_pref("ui.caretBlinkTime", -1);\n')
|
||||
|
||||
if options.totalChunks != None:
|
||||
prefsFile.write('user_pref("reftest.totalChunks", %d);\n' % options.totalChunks)
|
||||
|
@ -92,9 +91,6 @@ class RefTest(object):
|
|||
sys.exit(1)
|
||||
part = 'user_pref("%s", %s);\n' % (thispref[0], thispref[1])
|
||||
prefsFile.write(part)
|
||||
# no slow script dialogs
|
||||
prefsFile.write('user_pref("dom.max_script_run_time", 0);')
|
||||
prefsFile.write('user_pref("dom.max_chrome_script_run_time", 0);')
|
||||
prefsFile.close()
|
||||
|
||||
# install the reftest extension bits into the profile
|
||||
|
|
Загрузка…
Ссылка в новой задаче