def __init__(self, resource):
        """Initializes the facade objects."""

        # TODO: (crbug.com/618111) Add test driven switch for
        # supporting arc_mode enabled or disabled. At this time
        # if ARC build is tested, arc_mode is always enabled.
        arc_res = None
        if utils.get_board_property('CHROMEOS_ARC_VERSION'):
            logging.info('Using ARC resource on ARC enabled board.')
            from autotest_lib.client.cros.multimedia import arc_resource
            arc_res = arc_resource.ArcResource()

        self._facades = {
            'audio': audio_facade_native.AudioFacadeNative(
                    resource, arc_resource=arc_res),
            'video': video_facade_native.VideoFacadeNative(
                    resource, arc_resource=arc_res),
            'display': display_facade_native.DisplayFacadeNative(resource),
            'system': system_facade_native.SystemFacadeNative(),
            'usb': usb_facade_native.USBFacadeNative(),
            'browser': browser_facade_native.BrowserFacadeNative(resource),
            'input': input_facade_native.InputFacadeNative(),
            'cfm_main_screen': cfm_facade_native.CFMFacadeNative(
                              resource, 'hotrod'),
            'cfm_mimo_screen': cfm_facade_native.CFMFacadeNative(
                              resource, 'control'),
            'kiosk': kiosk_facade_native.KioskFacadeNative(resource)
        }
예제 #2
0
    def __init__(self, chrome):
        """Construct a DisplayFacadeLocalAdapter.

        @param chrome: A Chrome object.
        """
        # Create a DisplayFacadeNative object as a component such that this
        # class can expose and manipulate its interfaces.
        self._display_component = display_facade_native.DisplayFacadeNative(
            facade_resource.FacadeResource(chrome_object=chrome))
예제 #3
0
 def __init__(self, resource):
     """Initializes the facade objects."""
     self._facades = {
         'audio': audio_facade_native.AudioFacadeNative(resource),
         'display': display_facade_native.DisplayFacadeNative(resource),
         'system': system_facade_native.SystemFacadeNative(),
         'usb': usb_facade_native.USBFacadeNative(),
         'browser': browser_facade_native.BrowserFacadeNative(resource),
     }
예제 #4
0
    def set_rotation_to_zero(self, cr):
        # Set rotation to 0 (portrait) otherwise tablet platforms might not get
        # overlays.
        facade = facade_resource.FacadeResource(cr)

        display_facade = display_facade_native.DisplayFacadeNative(facade)
        internal_display_id = display_facade.get_internal_display_id()

        logging.info("Internal display ID is %s", internal_display_id)
        display_facade.set_display_rotation(internal_display_id, rotation=0)
예제 #5
0
    def __init__(self, resource, arc_resource=None):
        """Initializes an video facade.

        @param resource: A FacadeResource object.
        @param arc_resource: An ArcResource object.

        """
        self._resource = resource
        self._player = None
        self._arc_resource = arc_resource
        self._display_facade = display_facade_native.DisplayFacadeNative(
                resource)
        self.bindir = os.path.dirname(os.path.realpath(__file__))
 def run_once(self):
     """Test to rotate internal display"""
     facade = facade_resource.FacadeResource()
     facade.start_default_chrome()
     self.display_facade = display_facade_native.DisplayFacadeNative(facade)
     self.internal_display_id = self.display_facade.get_internal_display_id()
     logging.info("Internal display ID is %s", self.internal_display_id)
     rotation_before_starts = self.display_facade.get_display_rotation(
             self.internal_display_id)
     logging.info("Rotation before test starts is %d",
                  rotation_before_starts)
     for angle in self.ROTATIONS:
         logging.info("Rotation to be set %d", angle)
         self.display_facade.set_display_rotation(self.internal_display_id,
                                                  angle,
                                                  self.DELAY_BEFORE_ROTATION,
                                                  self.DELAY_AFTER_ROTATION)
         rotation = self.display_facade.get_display_rotation(
                 self.internal_display_id)
         logging.info("Internal display rotation is set to %s", rotation)
         if rotation != angle:
             raise error.TestFail('Failed to set %d rotation' % angle)