Esempio n. 1
0
from mozdevice import ADBAndroid, ADBHost, ADBError
import mozversion
import mozinstall
import zipfile
import mozinfo
import stat
from subprocess import call
from abc import ABCMeta, abstractmethod
from threading import Thread

from mozregression.class_registry import ClassRegistry
from mozregression.errors import LauncherNotRunnable, LauncherError
from mozregression.tempdir import safe_mkdtemp
import six

LOG = get_proxy_logger("Test Runner")


class Launcher(six.with_metaclass(ABCMeta)):
    """
    Handle the logic of downloading a build file, installing and
    running an application.
    """
    profile_class = Profile

    @classmethod
    def check_is_runnable(cls):
        """
        Check that the launcher can be created and can run on the system.

        :raises: :class:`LauncherNotRunnable`.
Esempio n. 2
0
import math
from mozlog.structured import get_proxy_logger


LOG = get_proxy_logger("windowController")

def pixel_color_is_similar(input_pixel_a, input_pixel_b, threshold=45, channel_number=3):
    """
    compare two pixel color similarity
    :param input_pixel_a:
    :param input_pixel_b:
    :param threshold:
    :param channel_number:
    :return:
    """
    is_similar = True
    sum = 0
    for channel_index in xrange(channel_number):
        delta = abs(input_pixel_a[channel_index] - input_pixel_b[channel_index])
        sum += delta
        if delta > threshold:
            is_similar = False
    if sum > threshold:
        is_similar = False
    return is_similar


def find_image_viewport(input_img_grab_obj):
    """
    find the image viewport (default will look into the white background space)
    :param input_rgb_pixels:
Esempio n. 3
0
from mozprofile import FirefoxProfile, ThunderbirdProfile, Profile
from mozrunner import Runner
from mozfile import rmtree
from mozdevice import ADBAndroid, ADBHost, ADBError
import mozversion
import mozinstall
import tempfile
import zipfile
import mozinfo
import stat
from subprocess import call

from mozregression.class_registry import ClassRegistry
from mozregression.errors import LauncherNotRunnable, LauncherError

LOG = get_proxy_logger("Test Runner")


class Launcher(object):
    """
    Handle the logic of downloading a build file, installing and
    running an application.
    """
    profile_class = Profile

    @classmethod
    def check_is_runnable(cls):
        """
        Check that the launcher can be created and can run on the system.

        :raises: :class:`LauncherNotRunnable`.