Changeset 275513 in webkit


Ignore:
Timestamp:
Apr 6, 2021 6:38:16 AM (3 years ago)
Author:
commit-queue@webkit.org
Message:

[GStreamer] Test harness should use a mock audio output device
https://bugs.webkit.org/show_bug.cgi?id=223888

Patch by Philippe Normand <pnormand@igalia.com> on 2021-04-06
Reviewed by Adrian Perez de Castro.

Prioritize the new fakeaudiosink over other platform sinks when running the layout and API
tests. Mute and volume handling will still be tested (mocked, actually) but no actual
rendering will be performed.

The pulseaudio "sanitizer" can't work with a pipewire-pulse server because dynamic module
(un)loading is heavily restricted in this new wrapper. Moreover relying on the default sinks
when running on desktop machines easily triggers unintended beeps when running the tests.

  • Scripts/webkitpy/port/gtk.py:

(GtkPort.init):
(GtkPort.setup_test_run):
(GtkPort.setup_environ_for_server):
(GtkPort.clean_up_test_run): Deleted.

  • Scripts/webkitpy/port/gtk_unittest.py:

(GtkPortTest):
(GtkPortTest.make_port): Deleted.

  • Scripts/webkitpy/port/pulseaudio_sanitizer.py: Removed.
  • Scripts/webkitpy/port/pulseaudio_sanitizer_mock.py: Removed.
  • Scripts/webkitpy/port/wpe.py:

(WPEPort.setup_environ_for_server):

  • Scripts/webkitpy/port/wpe_unittest.py:

(WPEPortTest):
(WPEPortTest.make_port): Deleted.

Location:
trunk/Tools
Files:
2 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r275506 r275513  
     12021-04-06  Philippe Normand  <pnormand@igalia.com>
     2
     3        [GStreamer] Test harness should use a mock audio output device
     4        https://bugs.webkit.org/show_bug.cgi?id=223888
     5
     6        Reviewed by Adrian Perez de Castro.
     7
     8        Prioritize the new fakeaudiosink over other platform sinks when running the layout and API
     9        tests. Mute and volume handling will still be tested (mocked, actually) but no actual
     10        rendering will be performed.
     11
     12        The pulseaudio "sanitizer" can't work with a pipewire-pulse server because dynamic module
     13        (un)loading is heavily restricted in this new wrapper. Moreover relying on the default sinks
     14        when running on desktop machines easily triggers unintended beeps when running the tests.
     15
     16        * Scripts/webkitpy/port/gtk.py:
     17        (GtkPort.__init__):
     18        (GtkPort.setup_test_run):
     19        (GtkPort.setup_environ_for_server):
     20        (GtkPort.clean_up_test_run): Deleted.
     21        * Scripts/webkitpy/port/gtk_unittest.py:
     22        (GtkPortTest):
     23        (GtkPortTest.make_port): Deleted.
     24        * Scripts/webkitpy/port/pulseaudio_sanitizer.py: Removed.
     25        * Scripts/webkitpy/port/pulseaudio_sanitizer_mock.py: Removed.
     26        * Scripts/webkitpy/port/wpe.py:
     27        (WPEPort.setup_environ_for_server):
     28        * Scripts/webkitpy/port/wpe_unittest.py:
     29        (WPEPortTest):
     30        (WPEPortTest.make_port): Deleted.
     31
    1322021-04-06  Aakash Jain  <aakash_jain@apple.com>
    233
  • trunk/Tools/Scripts/webkitpy/port/gtk.py

    r274474 r275513  
    3939from webkitpy.layout_tests.models.test_configuration import TestConfiguration
    4040from webkitpy.port.base import Port
    41 from webkitpy.port.pulseaudio_sanitizer import PulseAudioSanitizer
    4241from webkitpy.port.xvfbdriver import XvfbDriver
    4342from webkitpy.port.westondriver import WestonDriver
     
    5756    def __init__(self, *args, **kwargs):
    5857        super(GtkPort, self).__init__(*args, **kwargs)
    59         self._pulseaudio_sanitizer = PulseAudioSanitizer()
    6058        self._display_server = self.get_option("display_server")
    6159
     
    109107    def setup_test_run(self, device_type=None):
    110108        super(GtkPort, self).setup_test_run(device_type)
    111         self._pulseaudio_sanitizer.unload_pulseaudio_module()
    112109
    113110        if self.get_option("leaks"):
    114111            self._leakdetector.clean_leaks_files_from_results_directory()
    115 
    116     def clean_up_test_run(self):
    117         super(GtkPort, self).clean_up_test_run()
    118         self._pulseaudio_sanitizer.restore_pulseaudio_module()
    119112
    120113    def setup_environ_for_server(self, server_name=None):
     
    130123        self._copy_value_from_environ_if_set(environment, 'WEBKIT_DEBUG')
    131124        self._copy_value_from_environ_if_set(environment, 'WEBKIT_GST_USE_PLAYBIN3')
    132         self._copy_value_from_environ_if_set(environment, 'PULSE_SERVER')
    133         self._copy_value_from_environ_if_set(environment, 'PULSE_CLIENTCONFIG')
    134125        for gst_variable in ('DEBUG', 'DEBUG_DUMP_DOT_DIR', 'DEBUG_FILE', 'DEBUG_NO_COLOR',
    135126                             'PLUGIN_SCANNER', 'PLUGIN_PATH', 'PLUGIN_SYSTEM_PATH', 'REGISTRY',
    136127                             'PLUGIN_PATH_1_0'):
    137128            self._copy_value_from_environ_if_set(environment, 'GST_%s' % gst_variable)
     129
     130        gst_feature_rank_override = environment.get('GST_PLUGIN_FEATURE_RANK')
     131        environment['GST_PLUGIN_FEATURE_RANK'] = 'fakeaudiosink:max'
     132        if gst_feature_rank_override:
     133            environment['GST_PLUGIN_FEATURE_RANK'] += ',%s' % gst_feature_rank_override
    138134
    139135        # Configure the software libgl renderer if jhbuild ready and we test inside a virtualized window system
  • trunk/Tools/Scripts/webkitpy/port/gtk_unittest.py

    r274474 r275513  
    3737from webkitpy.port.config import clear_cached_configuration
    3838from webkitpy.port.gtk import GtkPort
    39 from webkitpy.port.pulseaudio_sanitizer_mock import PulseAudioSanitizerMock
    4039from webkitpy.port import port_testcase
    4140from webkitpy.thirdparty.mock import Mock
     
    4847    port_name = 'gtk'
    4948    port_maker = GtkPort
    50 
    51     # Additionally mocks out the PulseAudioSanitizer methods.
    52     def make_port(self, host=None, port_name=None, options=None, os_name=None, os_version=None, **kwargs):
    53         port = super(GtkPortTest, self).make_port(host, port_name, options, os_name, os_version, **kwargs)
    54         port._pulseaudio_sanitizer = PulseAudioSanitizerMock()
    55         return port
    5649
    5750    def test_default_baseline_search_path(self):
  • trunk/Tools/Scripts/webkitpy/port/wpe.py

    r272643 r275513  
    9898                             'PLUGIN_PATH_1_0'):
    9999            self._copy_value_from_environ_if_set(environment, 'GST_%s' % gst_variable)
     100
     101        gst_feature_rank_override = environment.get('GST_PLUGIN_FEATURE_RANK')
     102        environment['GST_PLUGIN_FEATURE_RANK'] = 'fakeaudiosink:max'
     103        if gst_feature_rank_override:
     104            environment['GST_PLUGIN_FEATURE_RANK'] += ',%s' % gst_feature_rank_override
     105
    100106        return environment
    101107
  • trunk/Tools/Scripts/webkitpy/port/wpe_unittest.py

    r265883 r275513  
    3636from webkitpy.port.config import clear_cached_configuration
    3737from webkitpy.port.wpe import WPEPort
    38 from webkitpy.port.pulseaudio_sanitizer_mock import PulseAudioSanitizerMock
    3938from webkitpy.port import port_testcase
    4039from webkitpy.thirdparty.mock import Mock
     
    4544    port_name = 'wpe'
    4645    port_maker = WPEPort
    47 
    48     # Additionally mocks out the PulseAudioSanitizer methods.
    49     def make_port(self, host=None, port_name=None, options=None, os_name=None, os_version=None, **kwargs):
    50         port = super(WPEPortTest, self).make_port(host, port_name, options, os_name, os_version, **kwargs)
    51         port._pulseaudio_sanitizer = PulseAudioSanitizerMock()
    52         return port
    5346
    5447    def test_default_baseline_search_path(self):
Note: See TracChangeset for help on using the changeset viewer.