mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 830430 - automation.py should read profile data from a file, r=jhammel
* * * Copy prefs general
This commit is contained in:
parent
7acb7dbc35
commit
1ba7849d22
@ -93,6 +93,7 @@ _LEAKTEST_DIR = $(DEPTH)/_leaktest
|
||||
_LEAKTEST_FILES = \
|
||||
automation.py \
|
||||
automationutils.py \
|
||||
$(topsrcdir)/testing/profiles/prefs_general.js \
|
||||
leaktest.py \
|
||||
bloatcycle.html \
|
||||
$(topsrcdir)/build/pgo/server-locations.txt \
|
||||
|
@ -43,6 +43,8 @@ except:
|
||||
import mozcrash
|
||||
# ---------------------------------------------------------------
|
||||
|
||||
_DEFAULT_PREFERENCE_FILE = os.path.join(SCRIPT_DIR, 'prefs_general.js')
|
||||
|
||||
_DEFAULT_WEB_SERVER = "127.0.0.1"
|
||||
_DEFAULT_HTTP_PORT = 8888
|
||||
_DEFAULT_SSL_PORT = 4443
|
||||
@ -433,11 +435,14 @@ class Automation(object):
|
||||
manifestFile.write(manifest)
|
||||
manifestFile.close()
|
||||
|
||||
def initializeProfile(self, profileDir, extraPrefs=[],
|
||||
useServerLocations=False,
|
||||
initialProfile=None):
|
||||
def initializeProfile(self, profileDir,
|
||||
extraPrefs=None,
|
||||
useServerLocations=False,
|
||||
initialProfile=None,
|
||||
prefsPath=_DEFAULT_PREFERENCE_FILE):
|
||||
" Sets up the standard testing profile."
|
||||
|
||||
extraPrefs = extraPrefs or []
|
||||
prefs = []
|
||||
# Start with a clean slate.
|
||||
shutil.rmtree(profileDir, True)
|
||||
@ -452,125 +457,9 @@ class Automation(object):
|
||||
self.setupPermissionsDatabase(profileDir,
|
||||
{'allowXULXBL':[(l.host, 'noxul' not in l.options) for l in locations]});
|
||||
|
||||
# NOTE: For refactoring purposes we are temporarily storing these prefs
|
||||
# in two locations. If you update a pref below, please also update
|
||||
# it in source/testing/profiles/prefs_general.js.
|
||||
# See bug 830430 for more details.
|
||||
part = """\
|
||||
user_pref("browser.console.showInPanel", true);
|
||||
user_pref("browser.dom.window.dump.enabled", true);
|
||||
user_pref("browser.firstrun.show.localepicker", false);
|
||||
user_pref("browser.firstrun.show.uidiscovery", false);
|
||||
user_pref("browser.startup.page", 0); // use about:blank, not browser.startup.homepage
|
||||
user_pref("browser.ui.layout.tablet", 0); // force tablet UI off
|
||||
user_pref("dom.allow_scripts_to_close_windows", true);
|
||||
user_pref("dom.disable_open_during_load", false);
|
||||
user_pref("dom.experimental_forms", true); // on for testing
|
||||
user_pref("dom.experimental_forms_range", true); // on for testing
|
||||
user_pref("dom.max_script_run_time", 0); // no slow script dialogs
|
||||
user_pref("hangmonitor.timeout", 0); // no hang monitor
|
||||
user_pref("dom.max_chrome_script_run_time", 0);
|
||||
user_pref("dom.popup_maximum", -1);
|
||||
user_pref("dom.send_after_paint_to_content", true);
|
||||
user_pref("dom.successive_dialog_time_limit", 0);
|
||||
user_pref("signed.applets.codebase_principal_support", true);
|
||||
user_pref("browser.shell.checkDefaultBrowser", false);
|
||||
user_pref("shell.checkDefaultClient", false);
|
||||
user_pref("browser.warnOnQuit", false);
|
||||
user_pref("accessibility.typeaheadfind.autostart", false);
|
||||
user_pref("javascript.options.showInConsole", true);
|
||||
user_pref("devtools.errorconsole.enabled", true);
|
||||
user_pref("devtools.debugger.remote-port", 6023);
|
||||
user_pref("layout.debug.enable_data_xbl", true);
|
||||
user_pref("browser.EULA.override", true);
|
||||
user_pref("javascript.options.jit_hardening", true);
|
||||
user_pref("gfx.color_management.force_srgb", true);
|
||||
user_pref("network.manage-offline-status", false);
|
||||
user_pref("dom.min_background_timeout_value", 1000);
|
||||
user_pref("test.mousescroll", true);
|
||||
user_pref("security.default_personal_cert", "Select Automatically"); // Need to client auth test be w/o any dialogs
|
||||
user_pref("network.http.prompt-temp-redirect", false);
|
||||
user_pref("media.cache_size", 100);
|
||||
user_pref("media.volume_scale", "0.01");
|
||||
user_pref("security.warn_viewing_mixed", false);
|
||||
user_pref("app.update.enabled", false);
|
||||
user_pref("app.update.staging.enabled", false);
|
||||
user_pref("browser.panorama.experienced_first_run", true); // Assume experienced
|
||||
user_pref("dom.w3c_touch_events.enabled", 1);
|
||||
user_pref("dom.undo_manager.enabled", true);
|
||||
user_pref("dom.webcomponents.enabled", true);
|
||||
// Set a future policy version to avoid the telemetry prompt.
|
||||
user_pref("toolkit.telemetry.prompted", 999);
|
||||
user_pref("toolkit.telemetry.notifiedOptOut", 999);
|
||||
// Existing tests assume there is no font size inflation.
|
||||
user_pref("font.size.inflation.emPerLine", 0);
|
||||
user_pref("font.size.inflation.minTwips", 0);
|
||||
|
||||
// Only load extensions from the application and user profile
|
||||
// AddonManager.SCOPE_PROFILE + AddonManager.SCOPE_APPLICATION
|
||||
user_pref("extensions.enabledScopes", 5);
|
||||
// Disable metadata caching for installed add-ons by default
|
||||
user_pref("extensions.getAddons.cache.enabled", false);
|
||||
// Disable intalling any distribution add-ons
|
||||
user_pref("extensions.installDistroAddons", false);
|
||||
|
||||
user_pref("geo.wifi.uri", "http://%(server)s/tests/dom/tests/mochitest/geolocation/network_geolocation.sjs");
|
||||
user_pref("geo.wifi.testing", true);
|
||||
user_pref("geo.ignore.location_filter", true);
|
||||
|
||||
user_pref("camino.warn_when_closing", false); // Camino-only, harmless to others
|
||||
|
||||
// Make url-classifier updates so rare that they won't affect tests
|
||||
user_pref("urlclassifier.updateinterval", 172800);
|
||||
// Point the url-classifier to the local testing server for fast failures
|
||||
user_pref("browser.safebrowsing.gethashURL", "http://%(server)s/safebrowsing-dummy/gethash");
|
||||
user_pref("browser.safebrowsing.keyURL", "http://%(server)s/safebrowsing-dummy/newkey");
|
||||
user_pref("browser.safebrowsing.updateURL", "http://%(server)s/safebrowsing-dummy/update");
|
||||
// Point update checks to the local testing server for fast failures
|
||||
user_pref("extensions.update.url", "http://%(server)s/extensions-dummy/updateURL");
|
||||
user_pref("extensions.update.background.url", "http://%(server)s/extensions-dummy/updateBackgroundURL");
|
||||
user_pref("extensions.blocklist.url", "http://%(server)s/extensions-dummy/blocklistURL");
|
||||
user_pref("extensions.hotfix.url", "http://%(server)s/extensions-dummy/hotfixURL");
|
||||
// Turn off extension updates so they don't bother tests
|
||||
user_pref("extensions.update.enabled", false);
|
||||
// Make sure opening about:addons won't hit the network
|
||||
user_pref("extensions.webservice.discoverURL", "http://%(server)s/extensions-dummy/discoveryURL");
|
||||
// Make sure AddonRepository won't hit the network
|
||||
user_pref("extensions.getAddons.maxResults", 0);
|
||||
user_pref("extensions.getAddons.get.url", "http://%(server)s/extensions-dummy/repositoryGetURL");
|
||||
user_pref("extensions.getAddons.getWithPerformance.url", "http://%(server)s/extensions-dummy/repositoryGetWithPerformanceURL");
|
||||
user_pref("extensions.getAddons.search.browseURL", "http://%(server)s/extensions-dummy/repositoryBrowseURL");
|
||||
user_pref("extensions.getAddons.search.url", "http://%(server)s/extensions-dummy/repositorySearchURL");
|
||||
// Make sure that opening the plugins check page won't hit the network
|
||||
user_pref("plugins.update.url", "http://%(server)s/plugins-dummy/updateCheckURL");
|
||||
|
||||
// Existing tests don't wait for the notification button security delay
|
||||
user_pref("security.notification_enable_delay", 0);
|
||||
|
||||
// Make enablePrivilege continue to work for test code. :-(
|
||||
user_pref("security.turn_off_all_security_so_that_viruses_can_take_over_this_computer", true);
|
||||
|
||||
// In the default configuration, we bypass XBL scopes (a security feature) for
|
||||
// domains whitelisted for remote XUL, so that intranet apps and such continue
|
||||
// to work without major rewrites. However, we also use the whitelist mechanism
|
||||
// to run our XBL tests in automation, in which case we really want to be testing
|
||||
// the configuration that we ship to users without special whitelisting. So we
|
||||
// use an additional pref here to allow automation to use the "normal" behavior.
|
||||
user_pref("dom.use_xbl_scopes_for_remote_xul", true);
|
||||
|
||||
// Get network events.
|
||||
user_pref("network.activity.blipIntervalMilliseconds", 250);
|
||||
|
||||
// Don't allow the Data Reporting service to prompt for policy acceptance.
|
||||
user_pref("datareporting.policy.dataSubmissionPolicyBypassAcceptance", true);
|
||||
|
||||
// Point Firefox Health Report at a local server. We don't care if it actually
|
||||
// works. It just can't hit the default production endpoint.
|
||||
user_pref("datareporting.healthreport.documentServerURI", "http://%(server)s/healthreport/");
|
||||
|
||||
// Make sure CSS error reporting is enabled for tests
|
||||
user_pref("layout.css.report_errors", true);
|
||||
""" % { "server" : self.webServer + ":" + str(self.httpPort) }
|
||||
f = open(prefsPath, 'r')
|
||||
part = f.read() % {"server" : "%s:%s" % (self.webServer, self.httpPort)}
|
||||
f.close()
|
||||
prefs.append(part)
|
||||
|
||||
if useServerLocations:
|
||||
@ -619,16 +508,15 @@ function FindProxyForURL(url, host)
|
||||
"sslport": self.sslPort }
|
||||
pacURL = "".join(pacURL.splitlines())
|
||||
|
||||
part += """
|
||||
part = """
|
||||
user_pref("network.proxy.type", 2);
|
||||
user_pref("network.proxy.autoconfig_url", "%(pacURL)s");
|
||||
|
||||
user_pref("camino.use_system_proxy_settings", false); // Camino-only, harmless to others
|
||||
""" % {"pacURL": pacURL}
|
||||
prefs.append(part)
|
||||
else:
|
||||
part = 'user_pref("network.proxy.type", 0);\n'
|
||||
prefs.append(part)
|
||||
prefs.append(part)
|
||||
|
||||
for v in extraPrefs:
|
||||
thispref = v.split("=", 1)
|
||||
|
@ -120,16 +120,6 @@ class B2GRemoteAutomation(Automation):
|
||||
self._devicemanager.removeDir(remote_dump_dir)
|
||||
return crashed
|
||||
|
||||
def initializeProfile(self, profileDir, extraPrefs=[],
|
||||
useServerLocations=False,
|
||||
initialProfile=None):
|
||||
# add b2g specific prefs
|
||||
extraPrefs.extend(["browser.manifestURL='dummy (bug 772307)'"])
|
||||
return Automation.initializeProfile(self, profileDir,
|
||||
extraPrefs,
|
||||
useServerLocations,
|
||||
initialProfile)
|
||||
|
||||
def buildCommandLine(self, app, debuggerInfo, profileDir, testURL, extraArgs):
|
||||
# if remote profile is specified, use that instead
|
||||
if (self._remoteProfile):
|
||||
|
@ -30,6 +30,7 @@ endif
|
||||
_PGO_FILES = \
|
||||
automation.py \
|
||||
$(topsrcdir)/build/automationutils.py \
|
||||
$(topsrcdir)/testing/profiles/prefs_general.js \
|
||||
profileserver.py \
|
||||
genpgocert.py \
|
||||
index.html \
|
||||
|
@ -588,7 +588,9 @@ class Mochitest(object):
|
||||
options.extraPrefs.append("testing.browserTestHarness.timeout=%d" % options.timeout)
|
||||
self.automation.initializeProfile(options.profilePath,
|
||||
options.extraPrefs,
|
||||
useServerLocations=True)
|
||||
useServerLocations=True,
|
||||
prefsPath=os.path.join(self.SCRIPT_DIRECTORY,
|
||||
'profile_data', 'prefs_general.js'))
|
||||
manifest = self.addChromeToProfile(options)
|
||||
self.copyExtraFilesToProfile(options)
|
||||
self.installExtensionsToProfile(options)
|
||||
|
@ -93,6 +93,14 @@ user_pref("security.notification_enable_delay", 0);
|
||||
// Make enablePrivilege continue to work for test code. :-(
|
||||
user_pref("security.turn_off_all_security_so_that_viruses_can_take_over_this_computer", true);
|
||||
|
||||
// In the default configuration, we bypass XBL scopes (a security feature) for
|
||||
// domains whitelisted for remote XUL, so that intranet apps and such continue
|
||||
// to work without major rewrites. However, we also use the whitelist mechanism
|
||||
// to run our XBL tests in automation, in which case we really want to be testing
|
||||
// the configuration that we ship to users without special whitelisting. So we
|
||||
// use an additional pref here to allow automation to use the "normal" behavior.
|
||||
user_pref("dom.use_xbl_scopes_for_remote_xul", true);
|
||||
|
||||
// Get network events.
|
||||
user_pref("network.activity.blipIntervalMilliseconds", 250);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user