Changeset 139095 in webkit
- Timestamp:
- Jan 8, 2013 12:23:47 PM (11 years ago)
- Location:
- trunk/Tools
- Files:
-
- 1 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r139090 r139095 1 2013-01-08 Zan Dobersek <zandobersek@gmail.com> 2 3 [EFL][GTK] Make the PulseAudioSanitizer an object on the EflPort, GtkPort 4 https://bugs.webkit.org/show_bug.cgi?id=106354 5 6 Reviewed by Eric Seidel. 7 8 Put the PulseAudioSanitizer object on the EflPort and GtkPort interfaces 9 instead of those two inheriting from it. Also add a mock object of the 10 sanitizer that's used in unit tests. 11 12 * Scripts/webkitpy/layout_tests/port/efl.py: 13 (EflPort): 14 (EflPort.__init__): 15 (EflPort.setup_test_run): 16 (EflPort.clean_up_test_run): 17 * Scripts/webkitpy/layout_tests/port/efl_unittest.py: Also correct the 18 importing order. 19 (EflPortTest.make_port): Put a mock PulseAudioSanitizer on the instance. 20 * Scripts/webkitpy/layout_tests/port/gtk.py: 21 (GtkPort): 22 (GtkPort.__init__): 23 (GtkPort.setup_test_run): 24 (GtkPort.clean_up_test_run): 25 * Scripts/webkitpy/layout_tests/port/gtk_unittest.py: Also correct the 26 importing order. 27 (GtkPortTest.make_port): Put a mock PulseAudioSanitizer on the instance. 28 * Scripts/webkitpy/layout_tests/port/pulseaudio_sanitizer.py: 29 (PulseAudioSanitizer.unload_pulseaudio_module): Stylize the method as public. 30 (PulseAudioSanitizer.restore_pulseaudio_module): Ditto. 31 * Scripts/webkitpy/layout_tests/port/pulseaudio_sanitizer_mock.py: Added. 32 (PulseAudioSanitizerMock): A simple mock interface for PulseAudioSanitizer. 33 (PulseAudioSanitizerMock.unload_pulseaudio_module): 34 (PulseAudioSanitizerMock.restore_pulseaudio_module): 35 1 36 2013-01-08 Jochen Eisinger <jochen@chromium.org> 2 37 -
trunk/Tools/Scripts/webkitpy/layout_tests/port/efl.py
r133036 r139095 35 35 from webkitpy.layout_tests.port.xvfbdriver import XvfbDriver 36 36 37 class EflPort(Port, PulseAudioSanitizer): 37 38 class EflPort(Port): 38 39 port_name = 'efl' 39 40 … … 46 47 self.webprocess_cmd_prefix = self.get_option('webprocess_cmd_prefix') 47 48 49 self._pulseaudio_sanitizer = PulseAudioSanitizer() 50 48 51 def _port_flag_for_scripts(self): 49 52 return "--efl" 50 53 51 54 def setup_test_run(self): 52 self._ unload_pulseaudio_module()55 self._pulseaudio_sanitizer.unload_pulseaudio_module() 53 56 54 57 def setup_environ_for_server(self, server_name=None): … … 74 77 def clean_up_test_run(self): 75 78 super(EflPort, self).clean_up_test_run() 76 self._ restore_pulseaudio_module()79 self._pulseaudio_sanitizer.restore_pulseaudio_module() 77 80 78 81 def _generate_all_test_configurations(self): -
trunk/Tools/Scripts/webkitpy/layout_tests/port/efl_unittest.py
r139084 r139095 27 27 import unittest 28 28 29 from webkitpy.common.system.executive_mock import MockExecutive 29 30 from webkitpy.common.system.outputcapture import OutputCapture 30 31 from webkitpy.layout_tests.port.efl import EflPort 32 from webkitpy.layout_tests.port.pulseaudio_sanitizer_mock import PulseAudioSanitizerMock 31 33 from webkitpy.layout_tests.port import port_testcase 32 from webkitpy.common.system.executive_mock import MockExecutive33 34 34 35 … … 40 41 def make_port(self, host=None, port_name=None, options=None, os_name=None, os_version=None, **kwargs): 41 42 port = super(EflPortTest, self).make_port(host, port_name, options, os_name, os_version, **kwargs) 42 port._unload_pulseaudio_module = lambda: None 43 port._restore_pulseaudio_module = lambda: None 43 port._pulseaudio_sanitizer = PulseAudioSanitizerMock() 44 44 return port 45 45 -
trunk/Tools/Scripts/webkitpy/layout_tests/port/gtk.py
r139088 r139095 36 36 37 37 38 class GtkPort(Port , PulseAudioSanitizer):38 class GtkPort(Port): 39 39 port_name = "gtk" 40 41 def __init__(self, *args, **kwargs): 42 super(GtkPort, self).__init__(*args, **kwargs) 43 self._pulseaudio_sanitizer = PulseAudioSanitizer() 40 44 41 45 def warn_if_bug_missing_in_test_expectations(self): … … 54 58 55 59 def setup_test_run(self): 56 self._ unload_pulseaudio_module()60 self._pulseaudio_sanitizer.unload_pulseaudio_module() 57 61 58 62 def clean_up_test_run(self): 59 63 super(GtkPort, self).clean_up_test_run() 60 self._ restore_pulseaudio_module()64 self._pulseaudio_sanitizer.restore_pulseaudio_module() 61 65 62 66 def setup_environ_for_server(self, server_name=None): -
trunk/Tools/Scripts/webkitpy/layout_tests/port/gtk_unittest.py
r139088 r139095 31 31 import os 32 32 33 from webkitpy.common.system.executive_mock import MockExecutive 34 from webkitpy.common.system.filesystem_mock import MockFileSystem 33 35 from webkitpy.common.system.outputcapture import OutputCapture 34 36 from webkitpy.layout_tests.port.gtk import GtkPort 37 from webkitpy.layout_tests.port.pulseaudio_sanitizer_mock import PulseAudioSanitizerMock 35 38 from webkitpy.layout_tests.port import port_testcase 36 from webkitpy.common.system.executive_mock import MockExecutive37 39 from webkitpy.thirdparty.mock import Mock 38 from webkitpy.common.system.filesystem_mock import MockFileSystem39 40 from webkitpy.tool.mocktool import MockOptions 40 41 … … 47 48 def make_port(self, host=None, port_name=None, options=None, os_name=None, os_version=None, **kwargs): 48 49 port = super(GtkPortTest, self).make_port(host, port_name, options, os_name, os_version, **kwargs) 49 port._unload_pulseaudio_module = lambda: None 50 port._restore_pulseaudio_module = lambda: None 50 port._pulseaudio_sanitizer = PulseAudioSanitizerMock() 51 51 return port 52 52 -
trunk/Tools/Scripts/webkitpy/layout_tests/port/pulseaudio_sanitizer.py
r115478 r139095 38 38 # Shared by GTK and EFL for pulseaudio sanitizing before running tests. 39 39 class PulseAudioSanitizer: 40 def _unload_pulseaudio_module(self):40 def unload_pulseaudio_module(self): 41 41 # Unload pulseaudio's module-stream-restore, since it remembers 42 42 # volume settings from different runs, and could affect … … 72 72 return 73 73 74 def _restore_pulseaudio_module(self):74 def restore_pulseaudio_module(self): 75 75 # If pulseaudio's module-stream-restore was previously unloaded, 76 76 # restore it back. We shouldn't need extra checks here, since an
Note: See TracChangeset
for help on using the changeset viewer.