Merge m-c to inbound

This commit is contained in:
Ryan VanderMeulen 2012-05-24 20:43:34 -04:00
commit bdbda03e1f
5 changed files with 52 additions and 19 deletions

View File

@ -0,0 +1,23 @@
#GONK_TOOLCHAIN_VERSION=0
#TOOLCHAIN_HOST=linux-x86
#export GONK_PRODUCT=generic
#gonk="/home/cjones/mozilla/gonk-toolchain-$GONK_TOOLCHAIN_VERSION"
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-b2g
mk_add_options MOZ_MAKE_FLAGS="-j8"
ac_add_options --enable-application=b2g
ac_add_options --target=arm-android-eabi
ac_add_options --with-gonk="$gonk"
ac_add_options --with-gonk-toolchain-prefix="$gonk/prebuilt/$TOOLCHAIN_HOST/toolchain/arm-eabi-4.4.3/bin/arm-eabi-"
ac_add_options --with-endian=little
ac_add_options --disable-elf-hack
ac_add_options --enable-debug-symbols
ac_add_options --enable-profiling
ac_add_options --with-ccache
ac_add_options --enable-marionette
# Enable dump() from JS.
export CXXFLAGS=-DMOZ_ENABLE_JS_DUMP

View File

@ -1 +1 @@
http://hg.mozilla.org/projects/addon-sdk/archive/e46dc20109f3.tar.bz2
http://hg.mozilla.org/projects/addon-sdk/archive/c1222a29a174.tar.bz2

View File

@ -37,7 +37,8 @@ class Emulator(object):
deviceRe = re.compile(r"^emulator-(\d+)(\s*)(.*)$")
def __init__(self, homedir=None, noWindow=False, logcat_dir=None, arch="x86", emulatorBinary=None):
def __init__(self, homedir=None, noWindow=False, logcat_dir=None, arch="x86",
emulatorBinary=None, userdata=None):
self.port = None
self._emulator_launched = False
self.proc = None
@ -54,6 +55,8 @@ class Emulator(object):
self.noWindow = noWindow
if self.homedir is not None:
self.homedir = os.path.expanduser(homedir)
self.dataImg = userdata
self.copy_userdata = self.dataImg is None
def _check_for_b2g(self):
if self.homedir is None:
@ -102,7 +105,8 @@ class Emulator(object):
self.sysDir = os.path.join(self.homedir, sysdir)
self._check_file(self.sysDir)
self.dataImg = os.path.join(self.sysDir, 'userdata.img')
if not self.dataImg:
self.dataImg = os.path.join(self.sysDir, 'userdata.img')
self._check_file(self.dataImg)
def __del__(self):
@ -246,12 +250,13 @@ class Emulator(object):
self._check_for_b2g()
self.start_adb()
# Make a copy of the userdata.img for this instance of the emulator
# to use.
self._tmp_userdata = tempfile.mktemp(prefix='marionette')
shutil.copyfile(self.dataImg, self._tmp_userdata)
qemu_args = self.args[:]
qemu_args[qemu_args.index('-data') + 1] = self._tmp_userdata
if self.copy_userdata:
# Make a copy of the userdata.img for this instance of the emulator
# to use.
self._tmp_userdata = tempfile.mktemp(prefix='marionette')
shutil.copyfile(self.dataImg, self._tmp_userdata)
qemu_args[qemu_args.index('-data') + 1] = self._tmp_userdata
original_online, original_offline = self._get_adb_devices()

View File

@ -2,8 +2,10 @@ from marionette import Marionette, Emulator
from optparse import OptionParser
def runemulator(homedir=None, url=None, pidfile=None, arch='x86', noWindow=False):
qemu = Emulator(homedir=homedir, arch=arch, noWindow=noWindow)
def runemulator(homedir=None, url=None, pidfile=None, arch='x86', noWindow=False,
userdata=None):
qemu = Emulator(homedir=homedir, arch=arch, noWindow=noWindow,
userdata=userdata)
qemu.start()
port = qemu.setup_port_forwarding(2828)
assert(qemu.wait_for_port())
@ -32,6 +34,8 @@ if __name__ == '__main__':
help='file in which to store emulator pid')
parser.add_option('--no-window', dest='noWindow', action='store_true',
help='pass -no-window to the emulator')
parser.add_option('--userdata', dest='userdata', action='store',
help='path to userdata.img file to use')
options, args = parser.parse_args()
if not options.repo_path:
@ -41,5 +45,6 @@ if __name__ == '__main__':
url=options.url,
pidfile=options.pidfile,
arch=options.arch,
noWindow=options.noWindow)
noWindow=options.noWindow,
userdata=options.userdata)

View File

@ -13,14 +13,14 @@ class TestEmulatorContent(MarionetteTestCase):
""");
self.assertEqual(result, expected)
def test_emulator_order(self):
self.marionette.set_script_timeout(10000)
self.assertRaises(MarionetteException,
self.marionette.execute_async_script,
"""runEmulatorCmd("gsm status", function(result) {});
marionetteScriptFinished(true);
""");
# disabled due to bug 758329
# def test_emulator_order(self):
# self.marionette.set_script_timeout(10000)
# self.assertRaises(MarionetteException,
# self.marionette.execute_async_script,
# """runEmulatorCmd("gsm status", function(result) {});
# marionetteScriptFinished(true);
# """);
class TestEmulatorChrome(TestEmulatorContent):