Skip to content

Commit

Permalink
Merge mozilla-central to mozilla-inbound
Browse files Browse the repository at this point in the history
  • Loading branch information
BavarianTomcat committed Feb 18, 2014
2 parents f29093a + 4380949 commit 674f256
Show file tree
Hide file tree
Showing 24 changed files with 219 additions and 61 deletions.
2 changes: 1 addition & 1 deletion b2g/config/emulator-ics/sources.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="ae90f9b322509ee09fbd3963bd23e142845613ab"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="258ae6472bd0e87ae074a6b9b464273dc9cfc8d6"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="78b908b493bfe0b477e3d4f6edec8c46a2c0d096"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="eda08beb3ba9a159843c70ffde0f9660ec351eb9"/>
Expand Down
2 changes: 1 addition & 1 deletion b2g/config/emulator-jb/sources.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</project>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="ae90f9b322509ee09fbd3963bd23e142845613ab"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="258ae6472bd0e87ae074a6b9b464273dc9cfc8d6"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="78b908b493bfe0b477e3d4f6edec8c46a2c0d096"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="3d5c964015967ca8c86abe6dbbebee3cb82b1609"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="a314508e397c8f1814228d36259ea8708034444e"/>
Expand Down
2 changes: 1 addition & 1 deletion b2g/config/emulator/sources.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="ae90f9b322509ee09fbd3963bd23e142845613ab"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="258ae6472bd0e87ae074a6b9b464273dc9cfc8d6"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="78b908b493bfe0b477e3d4f6edec8c46a2c0d096"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="eda08beb3ba9a159843c70ffde0f9660ec351eb9"/>
Expand Down
2 changes: 1 addition & 1 deletion b2g/config/gaia.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"revision": "1adfbae4582a2cebf4b35c822044299aa8dd1026",
"revision": "8d15cd3ac0d07cde9ff36ce611ae47e6ef30d9b0",
"repo_path": "/integration/gaia-central"
}
2 changes: 1 addition & 1 deletion b2g/config/hamachi/sources.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="ae90f9b322509ee09fbd3963bd23e142845613ab"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="258ae6472bd0e87ae074a6b9b464273dc9cfc8d6"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="78b908b493bfe0b477e3d4f6edec8c46a2c0d096"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="84f2f2fce22605e17d511ff1767e54770067b5b5"/>
Expand Down
2 changes: 1 addition & 1 deletion b2g/config/helix/sources.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="ae90f9b322509ee09fbd3963bd23e142845613ab"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="258ae6472bd0e87ae074a6b9b464273dc9cfc8d6"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="78b908b493bfe0b477e3d4f6edec8c46a2c0d096"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="84f2f2fce22605e17d511ff1767e54770067b5b5"/>
Expand Down
2 changes: 1 addition & 1 deletion b2g/config/inari/sources.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="ae90f9b322509ee09fbd3963bd23e142845613ab"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="258ae6472bd0e87ae074a6b9b464273dc9cfc8d6"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="78b908b493bfe0b477e3d4f6edec8c46a2c0d096"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="84f2f2fce22605e17d511ff1767e54770067b5b5"/>
Expand Down
2 changes: 1 addition & 1 deletion b2g/config/leo/sources.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="ae90f9b322509ee09fbd3963bd23e142845613ab"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="258ae6472bd0e87ae074a6b9b464273dc9cfc8d6"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="78b908b493bfe0b477e3d4f6edec8c46a2c0d096"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="84f2f2fce22605e17d511ff1767e54770067b5b5"/>
Expand Down
2 changes: 1 addition & 1 deletion b2g/config/mako/sources.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</project>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="ae90f9b322509ee09fbd3963bd23e142845613ab"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="258ae6472bd0e87ae074a6b9b464273dc9cfc8d6"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="78b908b493bfe0b477e3d4f6edec8c46a2c0d096"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="3d5c964015967ca8c86abe6dbbebee3cb82b1609"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="a314508e397c8f1814228d36259ea8708034444e"/>
Expand Down
2 changes: 1 addition & 1 deletion b2g/config/wasabi/sources.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="ae90f9b322509ee09fbd3963bd23e142845613ab"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="258ae6472bd0e87ae074a6b9b464273dc9cfc8d6"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="78b908b493bfe0b477e3d4f6edec8c46a2c0d096"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="84f2f2fce22605e17d511ff1767e54770067b5b5"/>
Expand Down
20 changes: 15 additions & 5 deletions testing/marionette/client/marionette/marionette_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,14 @@ def runTest(self):

if self.oop:
print 'running oop'
result = self.marionette.execute_async_script("""
frame = None
try:
frame = self.marionette.find_element(
'css selector',
'iframe[src*="app://test-container.gaiamobile.org/index.html"]'
)
except NoSuchElementException:
result = self.marionette.execute_async_script("""
let setReq = navigator.mozSettings.createLock().set({'lockscreen.enabled': false});
setReq.onsuccess = function() {
let appsReq = navigator.mozApps.mgmt.getAll();
Expand All @@ -445,14 +452,14 @@ def runTest(self):
setReq.onerror = function() {
marionetteScriptFinished(false);
}""", script_timeout=60000)
self.assertTrue(result)
self.assertTrue(result)

self.marionette.switch_to_frame(
self.marionette.find_element(
frame = self.marionette.find_element(
'css selector',
'iframe[src*="app://test-container.gaiamobile.org/index.html"]'
))
)

self.marionette.switch_to_frame(frame)
main_process = self.marionette.execute_script("""
return SpecialPowers.isMainProcess();
""")
Expand Down Expand Up @@ -509,5 +516,8 @@ def runTest(self):
self.loglines = self.marionette.get_logs()
raise

if self.oop:
self.marionette.switch_to_frame()

self.marionette.execute_script("log('TEST-END: %s');" % self.jsFile.replace('\\', '\\\\'))
self.marionette.test_name = None
148 changes: 102 additions & 46 deletions testing/marionette/client/marionette/runner/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -569,6 +569,7 @@ def __init__(self, address=None, emulator=None, emulatorBinary=None,
self.sdcard = sdcard
self.mixin_run_tests = []
self.manifest_skipped_tests = []
self.tests = []

if testvars:
if not os.path.exists(testvars):
Expand Down Expand Up @@ -750,15 +751,31 @@ def post_to_autolog(self, elapsedtime):
def run_tests(self, tests):
self.reset_test_stats()
starttime = datetime.utcnow()

if not self.httpd:
print "starting httpd"
self.start_httpd()

if not self.marionette:
self.start_marionette()
if self.emulator:
self.marionette.emulator.wait_for_homescreen(self.marionette)
# Retrieve capabilities for later use
if not self._capabilities:
self.capabilities

if self.capabilities['device'] != 'desktop':
self.textrunnerclass = B2GMarionetteTextTestRunner

for test in tests:
self.add_test(test)

counter = self.repeat
while counter >=0:
round = self.repeat - counter
if round > 0:
self.logger.info('\nREPEAT %d\n-------' % round)
if self.shuffle:
random.shuffle(tests)
for test in tests:
self.run_test(test)
self.run_test_sets()
counter -= 1
self.logger.info('\nSUMMARY\n-------')
self.logger.info('passed: %d' % self.passed)
Expand Down Expand Up @@ -795,21 +812,17 @@ def run_tests(self, tests):
for run_tests in self.mixin_run_tests:
run_tests(tests)

def run_test(self, test, expected='pass'):
if not self.httpd:
print "starting httpd"
self.start_httpd()

if not self.marionette:
self.start_marionette()
if self.emulator:
self.marionette.emulator.wait_for_homescreen(self.marionette)
# Retrieve capabilities for later use
if not self._capabilities:
self.capabilities
def add_test(self, test, expected='pass', oop=None):
filepath = os.path.abspath(test)

if self.capabilities['device'] != 'desktop':
self.textrunnerclass = B2GMarionetteTextTestRunner
if os.path.isdir(filepath):
for root, dirs, files in os.walk(filepath):
for filename in files:
if ((filename.startswith('test_') or filename.startswith('browser_')) and
(filename.endswith('.py') or filename.endswith('.js'))):
filepath = os.path.join(root, filename)
self.add_test(filepath)
return

testargs = {}
if self.type is not None:
Expand All @@ -821,29 +834,11 @@ def run_test(self, test, expected='pass'):
testargs.update({ atype[1:]: 'false' })
else:
testargs.update({ atype: 'true' })
oop = testargs.get('oop', False)
if isinstance(oop, basestring):
oop = False if oop == 'false' else 'true'

filepath = os.path.abspath(test)

if os.path.isdir(filepath):
for root, dirs, files in os.walk(filepath):
if self.shuffle:
random.shuffle(files)
for filename in files:
if ((filename.startswith('test_') or filename.startswith('browser_')) and
(filename.endswith('.py') or filename.endswith('.js'))):
filepath = os.path.join(root, filename)
self.run_test(filepath)
if self.marionette.check_for_crash():
return
return
# testarg_oop = either None, 'true' or 'false'.
testarg_oop = testargs.get('oop')

mod_name,file_ext = os.path.splitext(os.path.split(filepath)[-1])

testloader = unittest.TestLoader()
suite = unittest.TestSuite()
file_ext = os.path.splitext(os.path.split(filepath)[-1])[1]

if file_ext == '.ini':
manifest = TestManifest()
Expand All @@ -861,6 +856,11 @@ def run_test(self, test, expected='pass'):
else:
unfiltered_tests.append(test)

# Don't filter tests with "oop" flag because manifest parser can't
# handle it well.
if testarg_oop is not None:
del testargs['oop']

target_tests = manifest.get(tests=unfiltered_tests, **testargs)
for test in unfiltered_tests:
if test['path'] not in [x['path'] for x in target_tests]:
Expand All @@ -873,22 +873,62 @@ def run_test(self, test, expected='pass'):
test['disabled']))
self.todo += 1

if self.shuffle:
random.shuffle(target_tests)
for i in target_tests:
if not os.path.exists(i["path"]):
raise IOError("test file: %s does not exist" % i["path"])
self.run_test(i["path"], i["expected"])
if self.marionette.check_for_crash():
return

# manifest_oop is either 'false', 'true' or 'both'. Anything
# else implies 'false'.
manifest_oop = i.get('oop', 'false')

# We only add an oop test when following conditions are met:
# 1) It's written by javascript because we have only
# MarionetteJSTestCase that supports oop mode.
# 2) we're running with "--type=+oop" or no "--type=-oop", which
# follows testarg_oop is either None or 'true' and must not
# be 'false'.
# 3) When no "--type=[+-]oop" is applied, all active tests are
# included in target_tests, so we must filter out those
# really capable of running in oop mode. Besides, oop tests
# must be explicitly specified for backward compatibility. So
# test manifest_oop equals to either 'both' or 'true'.
file_ext = os.path.splitext(os.path.split(i['path'])[-1])[-1]
if (file_ext == '.js' and
testarg_oop != 'false' and
(manifest_oop == 'both' or manifest_oop == 'true')):
self.add_test(i["path"], i["expected"], True)

# We only add an in-process test when following conditions are
# met:
# 1) we're running with "--type=-oop" or no "--type=+oop", which
# follows testarg_oop is either None or 'false' and must not
# be 'true'.
# 2) When no "--type=[+-]oop" is applied, all active tests are
# included in target_tests, so we must filter out those
# really capable of running in in-process mode.
if (testarg_oop != 'true' and
(manifest_oop == 'both' or manifest_oop != 'true')):
self.add_test(i["path"], i["expected"], False)
return

self.logger.info('TEST-START %s' % os.path.basename(test))
if oop is None:
# This test is added by directory enumeration or directly specified
# in argument list. We have no manifest information here so we just
# respect the "--type=[+-]oop" argument here.
oop = file_ext == '.js' and testarg_oop == 'true'

self.tests.append({'filepath': filepath, 'expected': expected, 'oop': oop})

def run_test(self, filepath, expected, oop):
self.logger.info('TEST-START %s' % os.path.basename(filepath))

testloader = unittest.TestLoader()
suite = unittest.TestSuite()
self.test_kwargs['expected'] = expected
self.test_kwargs['oop'] = oop
mod_name = os.path.splitext(os.path.split(filepath)[-1])[0]
for handler in self.test_handlers:
if handler.match(os.path.basename(test)):
if handler.match(os.path.basename(filepath)):
handler.add_tests_to_suite(mod_name,
filepath,
suite,
Expand Down Expand Up @@ -918,6 +958,22 @@ def run_test(self, test, expected='pass'):
if hasattr(results, 'expectedFailures'):
self.passed += len(results.expectedFailures)

def run_test_set(self, tests):
if self.shuffle:
random.shuffle(tests)

for test in tests:
self.run_test(test['filepath'], test['expected'], test['oop'])
if self.marionette.check_for_crash():
break

def run_test_sets(self):
oop_tests = [x for x in self.tests if x.get('oop')]
self.run_test_set(oop_tests)

in_process_tests = [x for x in self.tests if not x.get('oop')]
self.run_test_set(in_process_tests)

def cleanup(self):
if self.httpd:
self.httpd.stop()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[DEFAULT]
qemu = false
browser = false
b2g = true
skip = false

oop = both

[test_success_both2.js]
; oop unspecified
[test_success_in_non_oop.js]
oop = false
[test_success_in_oop.js]
oop = true
[test_success_both.js]
oop = both
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[DEFAULT]
qemu = false
browser = false
b2g = true
skip = false

oop = false

[test_success_in_non_oop2.js]
; oop unspecified
[test_success_in_non_oop.js]
oop = false
[test_success_in_oop.js]
oop = true
[test_success_both.js]
oop = both
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[DEFAULT]
qemu = false
browser = false
b2g = true
skip = false

oop = true

[test_success_in_oop2.js]
; oop unspecified
[test_success_in_non_oop.js]
oop = false
[test_success_in_oop.js]
oop = true
[test_success_both.js]
oop = both
Loading

0 comments on commit 674f256

Please sign in to comment.