Mozilla Home
Privacy
Cookies
Legal
Bugzilla
Browse
Advanced Search
New Bug
Reports
Documentation
Log In
Log In with GitHub
or
Remember me
Browse
Advanced Search
New Bug
Reports
Documentation
Attachment 518906 Details for
Bug 613109
[patch]
Patch (v1)
613109.patch (text/plain), 5.89 KB, created by
(no longer active)
(
hide
)
Description:
Patch (v1)
Filename:
MIME Type:
Creator:
(no longer active)
Size:
5.89 KB
patch
obsolete
># HG changeset patch ># User Ehsan Akhgari <ehsan@mozilla.com> ># Date 1290118554 18000 ># Node ID 458a7453e925af0669215503f41c82a4a91f348b ># Parent a8b6eaaedce2755c4753ea3e19039335b4fe05a0 >Bug 613109 - Make it possible to run a mochitest-* test suite with an extension installed > >diff --git a/layout/tools/reftest/runreftest.py b/layout/tools/reftest/runreftest.py >--- a/layout/tools/reftest/runreftest.py >+++ b/layout/tools/reftest/runreftest.py >@@ -134,16 +134,17 @@ class RefTest(object): > debuggerInfo = getDebuggerInfo(self.oldcwd, options.debugger, options.debuggerArgs, > options.debuggerInteractive); > > profileDir = None > try: > profileDir = mkdtemp() > self.createReftestProfile(options, profileDir) > self.copyExtraFilesToProfile(options, profileDir) >+ self.installExtensionsToProfile(options, profileDir) > > # browser environment > browserEnv = self.buildBrowserEnv(options, profileDir) > > self.registerExtension(browserEnv, options, profileDir) > > # then again to actually run reftest > self.automation.log.info("REFTEST INFO | runreftest.py | Running tests: start.\n") >@@ -168,16 +169,23 @@ class RefTest(object): > for f in options.extraProfileFiles: > abspath = self.getFullPath(f) > dest = os.path.join(profileDir, os.path.basename(abspath)) > if os.path.isdir(abspath): > shutil.copytree(abspath, dest) > else: > shutil.copy(abspath, dest) > >+ def installExtensionsToProfile(self, options, profileDir): >+ "Install the specified extensions on the command line to the testing profile." >+ for f in options.extensionsToInstall: >+ abspath = self.getFullPath(f) >+ extensionID = f[:f.rfind(".")] >+ self.automation.installExtension(abspath, profileDir, extensionID) >+ > > class ReftestOptions(OptionParser): > > def __init__(self, automation): > self._automation = automation > OptionParser.__init__(self) > defaults = {} > >@@ -228,16 +236,23 @@ class ReftestOptions(OptionParser): > help = "file to log output to in addition to stdout") > defaults["logFile"] = None > > self.add_option("--skip-slow-tests", > dest = "skipSlowTests", action = "store_true", > help = "skip tests marked as slow when running") > defaults["skipSlowTests"] = False > >+ self.add_option("--install-extension", >+ action = "append", dest = "extensionsToInstall", >+ help = "install the specified extension in the testing profile." >+ "The extension file's name should be <id>.xpi where <id> is" >+ "the extension's id as indicated in its install.rdf.") >+ defaults["extensionsToInstall"] = [] >+ > self.set_defaults(**defaults) > > def main(): > automation = Automation() > parser = ReftestOptions(automation) > reftest = RefTest(automation) > > options, args = parser.parse_args() >diff --git a/testing/mochitest/runtests.py b/testing/mochitest/runtests.py >--- a/testing/mochitest/runtests.py >+++ b/testing/mochitest/runtests.py >@@ -202,16 +202,23 @@ class MochitestOptions(optparse.OptionPa > "(requires a debug build to be effective)") > defaults["fatalAssertions"] = False > > self.add_option("--extra-profile-file", > action = "append", dest = "extraProfileFiles", > help = "copy specified files/dirs to testing profile") > defaults["extraProfileFiles"] = [] > >+ self.add_option("--install-extension", >+ action = "append", dest = "extensionsToInstall", >+ help = "install the specified extension in the testing profile." >+ "The extension file's name should be <id>.xpi where <id> is" >+ "the extension's id as indicated in its install.rdf.") >+ defaults["extensionsToInstall"] = [] >+ > self.add_option("--profile-path", action = "store", > type = "string", dest = "profilePath", > help = "Directory where the profile will be stored." > "This directory will be deleted after the tests are finished") > defaults["profilePath"] = tempfile.mkdtemp() > > self.add_option("--use-vmware-recording", > action = "store_true", dest = "vmwareRecording", >@@ -488,16 +495,17 @@ class Mochitest(object): > self.copyExtraFilesToProfile(options) > > # We only need special powers in non-chrome harnesses > if (not options.browserChrome and > not options.chrome and > not options.a11y): > self.installSpecialPowersExtension(options) > >+ self.installExtensionsToProfile(options) > return manifest > > def buildBrowserEnv(self, options): > """ build the environment variables for the specific test and operating system """ > browserEnv = self.automation.environment(xrePath = options.xrePath) > > # These variables are necessary for correct application startup; change > # via the commandline at your own risk. >@@ -755,16 +763,23 @@ overlay chrome://browser/content/browser > for f in options.extraProfileFiles: > abspath = self.getFullPath(f) > dest = os.path.join(options.profilePath, os.path.basename(abspath)) > if os.path.isdir(abspath): > shutil.copytree(abspath, dest) > else: > shutil.copy(abspath, dest) > >+ def installExtensionsToProfile(self, options): >+ "Install the specified extensions on the command line to the testing profile." >+ for f in options.extensionsToInstall: >+ abspath = self.getFullPath(f) >+ extensionID = f[:f.rfind(".")] >+ self.automation.installExtension(abspath, options.profilePath, extensionID) >+ > def main(): > automation = Automation() > mochitest = Mochitest(automation) > parser = MochitestOptions(automation, mochitest.SCRIPT_DIRECTORY) > options, args = parser.parse_args() > > options = parser.verifyOptions(options, mochitest) > if options == None:
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
Flags:
ted
: review+
Actions:
View
|
Diff
|
Review
Attachments on
bug 613109
: 518906