third_party/blink/tools/blinkpy/web_tests/controllers/single_test_runner.py
def _update_or_add_new_baselines(self, driver_output, failures):
        """Updates or adds new baselines for the test if necessary."""
        if (test_failures.has_failure_type(test_failures.FailureTimeout,
                                           failures)
                or test_failures.has_failure_type(test_failures.FailureCrash,
                                                  failures)):
            return
        # We usually don't want to create a new baseline if there isn't one
        # existing (which usually means this baseline isn't necessary, e.g.
        # an image-only test without text expectation files). However, in the
        # following cases, we do:
        # 1. The failure is MISSING; a baseline is apparently needed.
        # 2. A testharness.js test fails assertions: testharness.js tests
        #    without baselines are implicitly expected to pass all assertions;
        #    if there are failed assertions we need to create a new baseline.
        #    Note that the created baseline might be redundant, but users can
        #    optimize them later with optimize-baselines.
        if self._is_all_pass_testharness_text_not_needing_baseline(
                self._convert_to_str(driver_output.text)):
            driver_output.text = None
        self._save_baseline_data(
            driver_output.text, '.txt',
            test_failures.has_failure_type(test_failures.FailureMissingResult,
                                           failures)
            or test_failures.has_failure_type(
                test_failures.FailureTestHarnessAssertion, failures))
        self._save_baseline_data(
            driver_output.audio, '.wav',
            test_failures.has_failure_type(test_failures.FailureMissingAudio,
                                           failures))

        expected_png = driver_output.image
        if self._reference_files:
            _log.warning('Can not rebaseline the image baseline of reftest %s',
                         self._test_name)
            # Let _save_baseline_data remove the '-expected.png' if it exists.
            expected_png = None
        self._save_baseline_data(
            expected_png, '.png',
            test_failures.has_failure_type(test_failures.FailureMissingImage,
                                           failures))
Updates or adds new baselines for the test if necessary.
Updates or adds new baselines for the test if necessary.
Updates or adds new baselines for the test if necessary .
def _update_or_add_new_baselines(self, driver_output, failures):
        if (test_failures.has_failure_type(test_failures.FailureTimeout,
                                           failures)
                or test_failures.has_failure_type(test_failures.FailureCrash,
                                                  failures)):
            return
        if self._is_all_pass_testharness_text_not_needing_baseline(
                self._convert_to_str(driver_output.text)):
            driver_output.text = None
        self._save_baseline_data(
            driver_output.text, '.txt',
            test_failures.has_failure_type(test_failures.FailureMissingResult,
                                           failures)
            or test_failures.has_failure_type(
                test_failures.FailureTestHarnessAssertion, failures))
        self._save_baseline_data(
            driver_output.audio, '.wav',
            test_failures.has_failure_type(test_failures.FailureMissingAudio,
                                           failures))
        expected_png = driver_output.image
        if self._reference_files:
            _log.warning('Can not rebaseline the image baseline of reftest %s',
                         self._test_name)
            expected_png = None
        self._save_baseline_data(
            expected_png, '.png',
            test_failures.has_failure_type(test_failures.FailureMissingImage,
                                           failures))
def _update_or_add_new_baselines ( self , driver_output , failures ) : if ( test_failures . has_failure_type ( test_failures . FailureTimeout , failures ) or test_failures . has_failure_type ( test_failures . FailureCrash , failures ) ) : return if self . _is_all_pass_testharness_text_not_needing_baseline ( self . _convert_to_str ( driver_output . text ) ) : driver_output . text = None self . _save_baseline_data ( driver_output . text , '.txt' , test_failures . has_failure_type ( test_failures . FailureMissingResult , failures ) or test_failures . has_failure_type ( test_failures . FailureTestHarnessAssertion , failures ) ) self . _save_baseline_data ( driver_output . audio , '.wav' , test_failures . has_failure_type ( test_failures . FailureMissingAudio , failures ) ) expected_png = driver_output . image if self . _reference_files : _log . warning ( 'Can not rebaseline the image baseline of reftest %s' , self . _test_name ) expected_png = None self . _save_baseline_data ( expected_png , '.png' , test_failures . has_failure_type ( test_failures . FailureMissingImage , failures ) )
Updates or adds new baselines for the test if necessary.
Updates or adds new baselines for the test if necessary .
"""Updates or adds new baselines for the test if necessary.""" # We usually don't want to create a new baseline if there isn't one # existing (which usually means this baseline isn't necessary, e.g. # an image-only test without text expectation files). However, in the # following cases, we do: # 1. The failure is MISSING; a baseline is apparently needed. # 2. A testharness.js test fails assertions: testharness.js tests #    without baselines are implicitly expected to pass all assertions; #    if there are failed assertions we need to create a new baseline. #    Note that the created baseline might be redundant, but users can #    optimize them later with optimize-baselines. # Let _save_baseline_data remove the '-expected.png' if it exists.
self
driver_output
failures