示例#1
0
    def __init__(self, display_facade, output_dir):
        """Initializes the MirrorComparer objects.

        @param display_facade: A display facade object
        @param output_dir: The directory for output images.
        """
        self._display_facade = display_facade
        int_capturer = screen_capture.CrosInternalScreenCapturer(
            display_facade)
        ext_capturer = screen_capture.CrosExternalScreenCapturer(
            display_facade)
        # The frame buffers of screens should be perfectly matched.
        self._screen_comparer = screen_comparison.ScreenComparer(
            int_capturer, ext_capturer, output_dir, 0, 0)
示例#2
0
    def create_calibration_comparer(self, output_dir):
        """Creates a comparer to check between Chameleon and calibration image.

        @param output_dir: The directory the image files output to.
        """
        if self._is_vga:
            pixel_diff_margin = self._PIXEL_DIFF_MARGIN_FOR_ANALOG
            wrong_pixels_margin = self._WRONG_PIXELS_MARGIN_FOR_ANALOG
        else:
            pixel_diff_margin = self._PIXEL_DIFF_MARGIN_FOR_CALIBRATION
            wrong_pixels_margin = self._WRONG_PIXELS_MARGIN_FOR_CALIBRATION

        capturer1 = self.create_chameleon_screen_capturer()
        capturer2 = self.create_calibration_image_capturer()

        return screen_comparison.ScreenComparer(capturer1, capturer2,
                                                output_dir, pixel_diff_margin,
                                                wrong_pixels_margin)
示例#3
0
    def create_screen_comparer(self, output_dir):
        """Creates a screen comparer.

        @param output_dir: The directory the image files output to.
        """
        if self._is_vga:
            pixel_diff_margin = self._PIXEL_DIFF_MARGIN_FOR_ANALOG
            wrong_pixels_margin = self._WRONG_PIXELS_MARGIN_FOR_ANALOG
        else:
            pixel_diff_margin = self._PIXEL_DIFF_MARGIN_FOR_DIGITAL
            wrong_pixels_margin = self._WRONG_PIXELS_MARGIN_FOR_DIGITAL

        capturer1 = self.create_chameleon_screen_capturer()
        capturer2 = self.create_cros_screen_capturer()

        return screen_comparison.ScreenComparer(capturer1, capturer2,
                                                output_dir, pixel_diff_margin,
                                                wrong_pixels_margin)