コード例 #1
0
    def run_test(self, test, timeout):
        # tests will be run warm (i.e. NO browser restart between page-cycles)
        # unless otheriwse specified in the test INI by using 'cold = true'
        try:

            if self.config["power_test"]:
                # gather OS baseline data
                init_android_power_test(self)
                LOG.info("Running OS baseline, pausing for 1 minute...")
                time.sleep(60)
                LOG.info("Finishing baseline...")
                finish_android_power_test(self,
                                          "os-baseline",
                                          os_baseline=True)

                # initialize for the test
                init_android_power_test(self)

            if test.get("cold", False) is True:
                self.__run_test_cold(test, timeout)
            else:
                self.__run_test_warm(test, timeout)

        except SignalHandlerException:
            self.device.stop_application(self.config["binary"])
            if self.config['power_test']:
                enable_charging(self.device)

        finally:
            if self.config["power_test"]:
                finish_android_power_test(self, test["name"])
コード例 #2
0
    def clean_up(self):
        LOG.info("removing test folder for raptor: %s" % self.remote_test_root)
        self.device.rm(self.remote_test_root, force=True, recursive=True)

        if self.config['power_test']:
            enable_charging(self.device)

        super(WebExtensionAndroid, self).clean_up()
コード例 #3
0
    def clean_up(self):
        LOG.info("removing test folder for raptor: %s" % self.remote_test_root)
        # We must use root=True since the browser will have created files in
        # the profile.
        self.device.rm(self.remote_test_root,
                       force=True,
                       recursive=True,
                       root=True)

        if self.config['power_test']:
            enable_charging(self.device)

        super(WebExtensionAndroid, self).clean_up()
コード例 #4
0
ファイル: android.py プロジェクト: crackself/iceweasel
    def run_tests(self, tests, test_names):
        self.setup_adb_device()

        if self.config["app"] == "chrome-m":
            # Make sure that chrome is enabled on the device
            self.device.shell_output("pm enable com.android.chrome")

        try:
            if self.config["power_test"]:
                disable_charging(self.device)
            return super(BrowsertimeAndroid, self).run_tests(tests, test_names)
        finally:
            if self.config["power_test"]:
                enable_charging(self.device)