Bug 1017484 - Use appropriate dependencies for the branch under test. r=wlachance

This commit is contained in:
Dave Hunt 2014-06-11 11:06:39 +01:00
Родитель 6d4ea85912
Коммит 8820e3008c
4 изменённых файлов: 92 добавлений и 15 удалений

39
set_version.sh Executable file
Просмотреть файл

@ -0,0 +1,39 @@
#!/bin/bash
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
NEW_VERSION=$1
VERSION_FILE="src/eideticker/eideticker/gaia_compat_version.txt"
if [ -f $VERSION_FILE ]; then
OLD_VERSION=$(head -n 1 $VERSION_FILE)
else
OLD_VERSION=""
fi
if [ "$OLD_VERSION" == "$NEW_VERSION" ]; then
echo "Target version is already installed. Nothing to do."
exit
fi
PACKAGES="gaiatest b2gpopulate"
for NAME in $PACKAGES; do
if [ "$OLD_VERSION" == "" ]; then
OLD_PACKAGE=$NAME
else
OLD_PACKAGE="$NAME-v$OLD_VERSION"
fi
/usr/bin/yes | pip uninstall $OLD_PACKAGE
if [ "$NEW_VERSION" == "" ]; then
NEW_PACKAGE=$NAME
else
NEW_PACKAGE="$NAME-v$NEW_VERSION"
fi
pip install $NEW_PACKAGE
done
echo $1 > $VERSION_FILE

Просмотреть файл

@ -12,7 +12,9 @@ import posixpath
import re
import tempfile
import time
from gaiatest.gaia_test import FakeUpdateChecker, GaiaDevice, GaiaData, GaiaApps
from gaia_compat import GaiaCompat
from gaiatest.gaia_test import GaiaDevice, GaiaData, GaiaApps
from b2gpopulate import B2GPopulate
# I know specifying resolution manually like this is ugly, but as far as I
@ -480,6 +482,7 @@ class EidetickerB2GMixin(EidetickerMixin):
self.gaiaApps = GaiaApps(self.marionette)
self.gaiaData = GaiaData(self.marionette)
self.gaiaDevice = GaiaDevice(self.marionette)
self.gaiaCompat = GaiaCompat()
def connectWIFI(self, wifiSettings):
"""
@ -515,21 +518,10 @@ class EidetickerB2GMixin(EidetickerMixin):
self._logger.info("Starting B2G")
self.shellCheckOutput(['start', 'b2g'])
self.setupMarionette()
self.gaiaData.set_setting('homescreen.manifestURL', 'app://homescreen.gaiamobile.org/manifest.webapp')
self.marionette.execute_async_script("""
window.addEventListener('mozbrowserloadend', function loaded(aEvent) {
if (aEvent.target.src.indexOf('ftu') != -1 || aEvent.target.src.indexOf('homescreen') != -1) {
window.removeEventListener('mozbrowserloadend', loaded);
marionetteScriptFinished();
}
});""", script_timeout=60000)
# TODO: Remove this sleep when Bug 924912 is addressed
time.sleep(5)
self.gaiaCompat.wait_for_b2g(self.marionette)
# run the fake update checker
FakeUpdateChecker(self.marionette).check_updates()
self.gaiaCompat.supress_update_check(self.marionette)
# unlock device, so it doesn't go to sleep
self._logger.info("Unlocking screen...")

Просмотреть файл

@ -0,0 +1,46 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
import os
import time
from marionette import By
from marionette import Wait
from marionette import expected
class GaiaCompat():
def __init__(self):
version_file = os.path.join(os.path.dirname(__file__),
'gaia_compat_version.txt')
self.version = 'master'
if os.path.isfile(version_file):
with open(version_file) as f:
self.version = f.readline().strip() or 'master'
print 'Gaia compatibility version: %s' % self.version
def supress_update_check(self, marionette):
if not self.version == '1.3':
# gaiatest v1.3 does not currently have the FakeUpdateChecker
from gaiatest import FakeUpdateChecker
FakeUpdateChecker(marionette).check_updates()
def wait_for_b2g(self, marionette, timeout=60):
if self.version == '1.3':
marionette.execute_async_script("""
window.addEventListener('mozbrowserloadend', function loaded(aEvent) {
if (/ftu|homescreen/.test(aEvent.target.src)) {
window.removeEventListener('mozbrowserloadend', loaded);
marionetteScriptFinished();
}
});""", script_timeout=timeout * 1000)
time.sleep(5)
else:
from gaiatest import GaiaData
GaiaData(marionette).set_setting(
'homescreen.manifestURL',
'app://homescreen.gaiamobile.org/manifest.webapp')
Wait(marionette, timeout).until(expected.element_present(
By.CSS_SELECTOR, '#homescreen[loading-state=false]'))

Просмотреть файл

@ -6,7 +6,7 @@ setup(
install_requires=[
'mozdevice>=0.36', 'mozlog>=1.5', 'mozprofile>=0.19',
'moznetwork>=0.24', 'mozhttpd>=0.7', 'BeautifulSoup',
'gaiatest==0.22', 'httplib2', 'b2gpopulate>=0.16',
'gaiatest>=0.22', 'httplib2', 'b2gpopulate>=0.16',
'templeton>=0.6', 'requests>=2.2.1'])
# FIXME: Compile decklink-capture script automatically