- Revision
- 113849
- Author
- [email protected]
- Date
- 2012-04-11 04:57:52 -0700 (Wed, 11 Apr 2012)
Log Message
[GTK] media/event-attributes.html fails
https://bugs.webkit.org/show_bug.cgi?id=71662
Patch by Simon Pena <[email protected]> on 2012-04-11
Reviewed by Philippe Normand.
Source/WebCore:
In MediaPlayerPrivateGStreamer::didEnd, when EOS is reached, don't
synchronize position and duration on regular playback. That is:
synchronize it (and fire the durationChange signal) only on reverse
playback.
This change makes media/event-attributes.html pass. It was
previously failing because an additional durationChange signal was
emitted.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: Avoid
sending durationChange signal on regular playback.
Tools:
PulseAudio's module "module-stream-restore" allows saving the volume
of a stream, restoring it the next time it runs.
This affects the tests, since DumpRenderTree's volume settings are
saved between test runs, and tests relying on specific volume values
would miss some volumeChange events (or get additional ones).
This patch hooks on the existing GtkPort setup_test_run method and
creates a new clean_up_test_run method, so PulseAudio's module is
unloaded (if found) before running the tests, and restored (if it
was there previously) after they finished, ensuring the tests run in
the right environment.
* Scripts/webkitpy/layout_tests/controllers/manager.py:
(Manager._clean_up_run): Invoke the port implementation of
clean_up_test_run.
* Scripts/webkitpy/layout_tests/port/base.py:
(Port.clean_up_test_run): Add an empty implementation of
clean_up_test_run.
* Scripts/webkitpy/layout_tests/port/gtk.py:
(GtkPort._unload_pulseaudio_module): Unloads the offending
pulseaudio module, if found.
(GtkPort):
(GtkPort._restore_pulseaudio_module): Restores the offending
pulseaudio module, if it was there previously.
(GtkPort.setup_test_run): Calls _unload_pulseaudio_module.
(GtkPort.clean_up_test_run): Calls _restore_pulseaudio_module.
LayoutTests:
Unskip tests media/video-seek-past-end-playing and
media/sources-fallback-codecs, which no longer fail, and
media/event-attributes, which is fixed with this patch.
* platform/gtk/Skipped: Unskip media/video-seek-past-end-playing,
media/sources-fallback-codecs and media/event-attributes
Modified Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (113848 => 113849)
--- trunk/LayoutTests/ChangeLog 2012-04-11 11:23:19 UTC (rev 113848)
+++ trunk/LayoutTests/ChangeLog 2012-04-11 11:57:52 UTC (rev 113849)
@@ -1,3 +1,17 @@
+2012-04-11 Simon Pena <[email protected]>
+
+ [GTK] media/event-attributes.html fails
+ https://bugs.webkit.org/show_bug.cgi?id=71662
+
+ Reviewed by Philippe Normand.
+
+ Unskip tests media/video-seek-past-end-playing and
+ media/sources-fallback-codecs, which no longer fail, and
+ media/event-attributes, which is fixed with this patch.
+
+ * platform/gtk/Skipped: Unskip media/video-seek-past-end-playing,
+ media/sources-fallback-codecs and media/event-attributes
+
2012-04-11 Philippe Normand <[email protected]>
Unreviewed, GTK gardening.
Modified: trunk/LayoutTests/platform/gtk/Skipped (113848 => 113849)
--- trunk/LayoutTests/platform/gtk/Skipped 2012-04-11 11:23:19 UTC (rev 113848)
+++ trunk/LayoutTests/platform/gtk/Skipped 2012-04-11 11:57:52 UTC (rev 113849)
@@ -642,8 +642,6 @@
# Tests in media/ directory
# Tests failing
media/video-size-intrinsic-scale.html
-media/video-seek-past-end-playing.html
-media/sources-fallback-codecs.html
# Tests in plugins/ directory
# Tests failing, need to implement NPP_HandleEvent() in TestNetscapePlugin
@@ -1170,9 +1168,6 @@
# https://bugs.webkit.org/show_bug.cgi?id=50441
media/controls-drag-timebar.html
-# https://bugs.webkit.org/show_bug.cgi?id=71662
-media/event-attributes.html
-
# https://bugs.webkit.org/show_bug.cgi?id=50740
editing/spelling/spelling-backspace-between-lines.html
editing/spelling/spellcheck-paste.html
Modified: trunk/Source/WebCore/ChangeLog (113848 => 113849)
--- trunk/Source/WebCore/ChangeLog 2012-04-11 11:23:19 UTC (rev 113848)
+++ trunk/Source/WebCore/ChangeLog 2012-04-11 11:57:52 UTC (rev 113849)
@@ -1,3 +1,22 @@
+2012-04-11 Simon Pena <[email protected]>
+
+ [GTK] media/event-attributes.html fails
+ https://bugs.webkit.org/show_bug.cgi?id=71662
+
+ Reviewed by Philippe Normand.
+
+ In MediaPlayerPrivateGStreamer::didEnd, when EOS is reached, don't
+ synchronize position and duration on regular playback. That is:
+ synchronize it (and fire the durationChange signal) only on reverse
+ playback.
+
+ This change makes media/event-attributes.html pass. It was
+ previously failing because an additional durationChange signal was
+ emitted.
+
+ * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: Avoid
+ sending durationChange signal on regular playback.
+
2012-04-11 Andras Becsi <[email protected]>
Fix the build with gcc 4.7.0
Modified: trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp (113848 => 113849)
--- trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp 2012-04-11 11:23:19 UTC (rev 113848)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp 2012-04-11 11:57:52 UTC (rev 113849)
@@ -1366,10 +1366,10 @@
void MediaPlayerPrivateGStreamer::didEnd()
{
// EOS was reached but in case of reverse playback the position is
- // not always 0. So to not confuse the HTMLMediaElement we
- // synchronize position and duration values.
+ // not always 0. So to not confuse the HTMLMediaElement, if we're
+ // doing reverse playback, we synchronize position and duration values.
float now = currentTime();
- if (now > 0) {
+ if (now > 0 && m_playbackRate < 0) {
m_mediaDuration = now;
m_mediaDurationKnown = true;
m_player->durationChanged();
Modified: trunk/Tools/ChangeLog (113848 => 113849)
--- trunk/Tools/ChangeLog 2012-04-11 11:23:19 UTC (rev 113848)
+++ trunk/Tools/ChangeLog 2012-04-11 11:57:52 UTC (rev 113849)
@@ -1,3 +1,37 @@
+2012-04-11 Simon Pena <[email protected]>
+
+ [GTK] media/event-attributes.html fails
+ https://bugs.webkit.org/show_bug.cgi?id=71662
+
+ Reviewed by Philippe Normand.
+
+ PulseAudio's module "module-stream-restore" allows saving the volume
+ of a stream, restoring it the next time it runs.
+ This affects the tests, since DumpRenderTree's volume settings are
+ saved between test runs, and tests relying on specific volume values
+ would miss some volumeChange events (or get additional ones).
+
+ This patch hooks on the existing GtkPort setup_test_run method and
+ creates a new clean_up_test_run method, so PulseAudio's module is
+ unloaded (if found) before running the tests, and restored (if it
+ was there previously) after they finished, ensuring the tests run in
+ the right environment.
+
+ * Scripts/webkitpy/layout_tests/controllers/manager.py:
+ (Manager._clean_up_run): Invoke the port implementation of
+ clean_up_test_run.
+ * Scripts/webkitpy/layout_tests/port/base.py:
+ (Port.clean_up_test_run): Add an empty implementation of
+ clean_up_test_run.
+ * Scripts/webkitpy/layout_tests/port/gtk.py:
+ (GtkPort._unload_pulseaudio_module): Unloads the offending
+ pulseaudio module, if found.
+ (GtkPort):
+ (GtkPort._restore_pulseaudio_module): Restores the offending
+ pulseaudio module, if it was there previously.
+ (GtkPort.setup_test_run): Calls _unload_pulseaudio_module.
+ (GtkPort.clean_up_test_run): Calls _restore_pulseaudio_module.
+
2012-04-11 Andras Becsi <[email protected]>
Fix the build with gcc 4.7.0
Modified: trunk/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py (113848 => 113849)
--- trunk/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py 2012-04-11 11:23:19 UTC (rev 113848)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py 2012-04-11 11:57:52 UTC (rev 113849)
@@ -970,6 +970,8 @@
sys.stderr.flush()
_log.debug("stopping helper")
self._port.stop_helper()
+ _log.debug("cleaning up port")
+ self._port.clean_up_test_run()
def update_summary(self, result_summary):
"""Update the summary and print results with any completed tests."""
Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/base.py (113848 => 113849)
--- trunk/Tools/Scripts/webkitpy/layout_tests/port/base.py 2012-04-11 11:23:19 UTC (rev 113848)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/base.py 2012-04-11 11:57:52 UTC (rev 113849)
@@ -728,6 +728,10 @@
"""Perform port-specific work at the beginning of a test run."""
pass
+ def clean_up_test_run(self):
+ """Perform port-specific work at the end of a test run."""
+ pass
+
# FIXME: os.environ access should be moved to onto a common/system class to be more easily mockable.
def _value_or_default_from_environ(self, name, default=None):
if name in os.environ:
Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/gtk.py (113848 => 113849)
--- trunk/Tools/Scripts/webkitpy/layout_tests/port/gtk.py 2012-04-11 11:23:19 UTC (rev 113848)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/gtk.py 2012-04-11 11:57:52 UTC (rev 113849)
@@ -76,6 +76,34 @@
def _driver_class(self):
return GtkDriver
+ def _unload_pulseaudio_module(self):
+ # Unload pulseaudio's module-stream-restore, since it remembers
+ # volume settings from different runs, and could affect
+ # multimedia tests results
+ with open(os.devnull, 'w') as devnull:
+ pactl_process = subprocess.Popen(["pactl", "list", "short", "modules"], stdout=subprocess.PIPE, stderr=devnull)
+ modules_list = pactl_process.communicate()[0]
+ self._pa_module_index = -1
+ for module in modules_list.splitlines():
+ if module.find("module-stream-restore") >= 0:
+ self._pa_module_index = module.split('\t')[0]
+ break
+ if int(self._pa_module_index) != -1:
+ subprocess.Popen(["pactl", "unload-module", self._pa_module_index])
+
+ def _restore_pulseaudio_module(self):
+ # If pulseaudio's module-stream-restore was previously unloaded,
+ # restore it back.
+ if self._pa_module_index != -1:
+ with open(os.devnull, 'w') as devnull:
+ subprocess.Popen(["pactl", "load-module", "module-stream-restore"], stdout=devnull, stderr=devnull)
+
+ def setup_test_run(self):
+ self._unload_pulseaudio_module()
+
+ def clean_up_test_run(self):
+ self._restore_pulseaudio_module()
+
def setup_environ_for_server(self, server_name=None):
environment = WebKitPort.setup_environ_for_server(self, server_name)
environment['GTK_MODULES'] = 'gail'