bug 1041347 - Package and provide path to fake GMP plugin for Mochitests. r=jmaher

This commit is contained in:
Ted Mielczarek 2014-07-25 07:01:13 -04:00
parent e178d7cc27
commit 6344615ad6
5 changed files with 36 additions and 7 deletions

View File

@ -64,8 +64,7 @@ skip-if = toolkit == 'gonk' || toolkit == 'android' # no screenshare on b2g/andr
[test_peerConnection_basicWindowshare.html]
skip-if = toolkit == 'gonk' || toolkit == 'android' # no windowshare on b2g/android
[test_peerConnection_basicH264Video.html]
skip-if = true # disabled until we can resolve plugin installation issues
#skip-if = toolkit == 'gonk' || toolkit == 'android' # no openh264 on b2g/android
skip-if = buildapp == 'b2g' || os == 'android' # bug 1043403
[test_peerConnection_bug822674.html]
[test_peerConnection_bug825703.html]
[test_peerConnection_bug827843.html]

View File

@ -163,6 +163,10 @@ TEST_HARNESS_PLUGINS := \
$(DLL_PREFIX)nptestjava$(DLL_SUFFIX)
endif
GMP_TEST_FILES := \
$(topsrcdir)/dom/media/gmp-plugin/fake.info \
$(DEPTH)/dom/media/gmp-plugin/$(DLL_PREFIX)fake$(DLL_SUFFIX)
# Rules for staging the necessary harness bits for a test package
PKG_STAGE = $(DIST)/test-stage
DIST_BIN = $(DIST)/bin
@ -171,7 +175,7 @@ $(_DEST_DIR):
$(NSINSTALL) -D $@
stage-package:
$(NSINSTALL) -D $(PKG_STAGE)/mochitest && $(NSINSTALL) -D $(PKG_STAGE)/bin/plugins && $(NSINSTALL) -D $(DIST)/plugins
$(NSINSTALL) -D $(PKG_STAGE)/mochitest && $(NSINSTALL) -D $(PKG_STAGE)/bin/plugins && $(NSINSTALL) -D $(DIST)/plugins && $(NSINSTALL) -D $(PKG_STAGE)/bin/plugins/gmp-fake
cp $(DEPTH)/mozinfo.json $(PKG_STAGE)/mochitest
(cd $(DEPTH)/_tests/testing && tar $(TAR_CREATE_FLAGS) - mochitest) | (cd $(PKG_STAGE) && tar -xf -)
@cp $(DEPTH)/mozinfo.json $(PKG_STAGE)/mochitest
@ -179,3 +183,4 @@ stage-package:
@(cd $(DIST_BIN)/components && tar $(TAR_CREATE_FLAGS) - $(TEST_HARNESS_COMPONENTS)) | (cd $(PKG_STAGE)/bin/components && tar -xf -)
(cd $(topsrcdir)/build/pgo && tar $(TAR_CREATE_FLAGS) - certs) | (cd $(PKG_STAGE) && tar -xf -)
@(cd $(DIST)/plugins && tar $(TAR_CREATE_FLAGS) - $(TEST_HARNESS_PLUGINS)) | (cd $(PKG_STAGE)/bin/plugins && tar -xf -)
$(foreach x,$(GMP_TEST_FILES),cp $(x) $(PKG_STAGE)/bin/plugins/gmp-fake;)

View File

@ -1132,6 +1132,19 @@ class Mochitest(MochitestUtilsMixin):
return manifest
def getGMPPluginPath(self, options):
# For local builds, gmp-fake will be under dist/bin.
gmp_path = os.path.join(options.xrePath, 'gmp-fake')
if os.path.isdir(gmp_path):
return gmp_path
# For packaged builds, gmp-fake will get copied under $profile/plugins.
gmp_path = os.path.join(self.profile.profile, 'plugins', 'gmp-fake')
if os.path.isdir(gmp_path):
return gmp_path
# This is fatal for desktop environments.
raise EnvironmentError('Could not find gmp-fake')
def buildBrowserEnv(self, options, debugger=False):
"""build the environment variables for the specific test and operating system"""
if mozinfo.info["asan"]:
@ -1151,13 +1164,17 @@ class Mochitest(MochitestUtilsMixin):
browserEnv.update(dict(parseKeyValue(options.environment, context='--setenv')))
except KeyValueParseError, e:
log.error(str(e))
return
return None
browserEnv["XPCOM_MEM_BLOAT_LOG"] = self.leak_report_file
# GMP fake plugin
# XXX should find a better solution
browserEnv["MOZ_GMP_PATH"] = options.xrePath + "/gmp-fake"
try:
gmp_path = self.getGMPPluginPath(options)
if gmp_path is not None:
browserEnv["MOZ_GMP_PATH"] = gmp_path
except EnvironmentError:
log.error('Could not find path to gmp-fake plugin!')
return None
if options.fatalAssertions:
browserEnv["XPCOM_DEBUG_BREAK"] = "stack-and-abort"

View File

@ -212,6 +212,10 @@ class B2GMochitest(MochitestUtilsMixin):
self.cleanup(manifest, options)
return status
def getGMPPluginPath(self, options):
# TODO: bug 1043403
return None
class B2GDeviceMochitest(B2GMochitest, Mochitest):
remote_log = None

View File

@ -551,6 +551,10 @@ class MochiRemote(Mochitest):
self._dm.pushFile(fHandle.name, os.path.join(deviceRoot, "robotium.config"))
os.unlink(fHandle.name)
def getGMPPluginPath(self, options):
# TODO: bug 1043403
return None
def buildBrowserEnv(self, options, debugger=False):
browserEnv = Mochitest.buildBrowserEnv(self, options, debugger=debugger)
self.buildRobotiumConfig(options, browserEnv)