def run_once(self):
        """
        Open browser, and affect brightness using  up and down functions.

        @raises: error.TestFail if brightness keys (F6/F7) did not work.

        """
        # Check for internal_display
        if not graphics_utils.has_internal_display():
            raise error.TestNAError('Test can not proceed on '
                                    'devices without internal display.')
        with chrome.Chrome():
            self.test_brightness_up()
            self.test_brightness_down()
Exemplo n.º 2
0
    def run_once(self):
        """
        Open browser, and affect brightness using  up and down functions.

        @raises: error.TestFail if brightness keys (F6/F7) did not work.

        """
        # Check for internal_display
        if not graphics_utils.has_internal_display():
            raise error.TestNAError('Test can not proceed on '
                                    'devices without internal display.')
        with chrome.Chrome():
            logging.info("Increasing the initial brightness to max without "
                         "verifying brightness.")
            # Not using command to set max brightness because
            # the brightness button stays at the current level
            # only irrespective of the command
            self.test_brightness_up(verify_brightness=False)
            # Actual test starts from here.
            self.test_brightness_down(verify_brightness=True)
            self.test_brightness_up(verify_brightness=True)
Exemplo n.º 3
0
    def generate_labels(self, host):
        from autotest_lib.client.cros.graphics import graphics_utils
        from autotest_lib.client.common_lib import utils as common_utils

        def __system_output(cmd):
            return host.run(cmd).stdout

        def __read_file(remote_path):
            return host.run('cat %s' % remote_path).stdout

        # Hijack the necessary client functions so that we can take advantage
        # of the client lib here.
        # FIXME: find a less hacky way than this
        original_system_output = utils.system_output
        original_read_file = common_utils.read_file
        utils.system_output = __system_output
        common_utils.read_file = __read_file
        try:
            return ([self._NAME]
                    if graphics_utils.has_internal_display() else [])
        finally:
            utils.system_output = original_system_output
            common_utils.read_file = original_read_file