[GTK] r114021 triggered media flakyness
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 18 Apr 2012 15:44:13 +0000 (15:44 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 18 Apr 2012 15:44:13 +0000 (15:44 +0000)
https://bugs.webkit.org/show_bug.cgi?id=83874

Patch by Simon Pena <spena@igalia.com> on 2012-04-18
Reviewed by Philippe Normand.

Source/WebKit/gtk:

When the MediaPlaybackRequiresUserGesture setting was added, no gtk
API was implemented to access it.

This adds a property to gtk WebKit WebSettings, and connects it to
WebKit WebView, thus allowing clients to programmatically modify it.

* webkit/webkitwebsettings.cpp:
(webkit_web_settings_class_init):
(webkit_web_settings_set_property):
(webkit_web_settings_get_property):
* webkit/webkitwebsettingsprivate.h:
* webkit/webkitwebview.cpp:
(webkit_web_view_update_settings):
(webkit_web_view_settings_notify):

Tools:

Now that there is gtk API to update the
MediaPlaybackRequiresUserGesture property, set it to false from the
DumpRenderTree tool when resetting defaults to consistent values.

* DumpRenderTree/gtk/DumpRenderTree.cpp:
(resetDefaultsToConsistentValues):

LayoutTests:

media/video-load-require-user-gesture.html and
media/video-play-require-user-gesture.html where enabling
MediaPlaybackRequiresUserGesture when run, so tests running
concurrently would fail -they would pass when run independently.

Since new API is added to ensure DumpRenderTree is able to reset
that setting, having media/video-load-require-user-gesture.html and
media/video-play-require-user-gesture.html no longer causes
flakiness.

* platform/gtk/test_expectations.txt: Unskip
media/video-load-require-user-gesture.html and
media/video-play-require-user-gesture.html

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@114506 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/platform/gtk/test_expectations.txt
Source/WebKit/gtk/ChangeLog
Source/WebKit/gtk/webkit/webkitwebsettings.cpp
Source/WebKit/gtk/webkit/webkitwebsettingsprivate.h
Source/WebKit/gtk/webkit/webkitwebview.cpp
Tools/ChangeLog
Tools/DumpRenderTree/gtk/DumpRenderTree.cpp

index 020c904..6c4f033 100644 (file)
@@ -1,3 +1,24 @@
+2012-04-18  Simon Pena  <spena@igalia.com>
+
+        [GTK] r114021 triggered media flakyness
+        https://bugs.webkit.org/show_bug.cgi?id=83874
+
+        Reviewed by Philippe Normand.
+
+        media/video-load-require-user-gesture.html and
+        media/video-play-require-user-gesture.html where enabling
+        MediaPlaybackRequiresUserGesture when run, so tests running
+        concurrently would fail -they would pass when run independently.
+
+        Since new API is added to ensure DumpRenderTree is able to reset
+        that setting, having media/video-load-require-user-gesture.html and
+        media/video-play-require-user-gesture.html no longer causes
+        flakiness.
+
+        * platform/gtk/test_expectations.txt: Unskip
+        media/video-load-require-user-gesture.html and
+        media/video-play-require-user-gesture.html
+
 2012-04-18  Yury Semikhatsky  <yurys@chromium.org>
 
         Web Inspector: DataGrid should use explicit root node
index 8e7e873..ab98676 100644 (file)
@@ -1549,11 +1549,6 @@ BUGWKGTK : editing/spelling/spelling-marker-description.html = FAIL
 BUGWK69933 : fast/borders/inline-mask-overlay-image-outset-vertical-rl.html = FAIL
 BUGWK69933 : fast/borders/inline-mask-overlay-image-outset.html = FAIL
 
-// Running those two make other media tests flaky, so skip until
-// proper investigation can be made.
-BUGWK83874 SKIP : media/video-load-require-user-gesture.html = FAIL
-BUGWK83874 SKIP : media/video-play-require-user-gesture.html = FAIL
-
 BUGWK84025 : media/sources-fallback-codecs.html = FAIL
 
 BUGWK83906 : ietestcenter/css3/grid/grid-column-001.htm = IMAGE
index 235f1b5..431f5f6 100644 (file)
@@ -1,3 +1,25 @@
+2012-04-18  Simon Pena  <spena@igalia.com>
+
+        [GTK] r114021 triggered media flakyness
+        https://bugs.webkit.org/show_bug.cgi?id=83874
+
+        Reviewed by Philippe Normand.
+
+        When the MediaPlaybackRequiresUserGesture setting was added, no gtk
+        API was implemented to access it.
+
+        This adds a property to gtk WebKit WebSettings, and connects it to
+        WebKit WebView, thus allowing clients to programmatically modify it.
+
+        * webkit/webkitwebsettings.cpp:
+        (webkit_web_settings_class_init):
+        (webkit_web_settings_set_property):
+        (webkit_web_settings_get_property):
+        * webkit/webkitwebsettingsprivate.h:
+        * webkit/webkitwebview.cpp:
+        (webkit_web_view_update_settings):
+        (webkit_web_view_settings_notify):
+
 2012-04-17  Carlos Garnacho  <carlos@lanedo.com>
 
         [GTK] Enable back double buffering on WebKitWebView to fix flickering
index 1a3a27e..5b47842 100644 (file)
@@ -121,7 +121,8 @@ enum {
     PROP_ENABLE_WEBGL,
     PROP_ENABLE_WEB_AUDIO,
     PROP_ENABLE_ACCELERATED_COMPOSITING,
-    PROP_ENABLE_SMOOTH_SCROLLING
+    PROP_ENABLE_SMOOTH_SCROLLING,
+    PROP_MEDIA_PLAYBACK_REQUIRES_USER_GESTURE
 };
 
 // Create a default user agent string
@@ -972,6 +973,24 @@ static void webkit_web_settings_class_init(WebKitWebSettingsClass* klass)
                                                          _("Whether to enable smooth scrolling"),
                                                          FALSE,
                                                          flags));
+
+    /**
+    * WebKitWebSettings:media-playback-requires-user-gesture
+    *
+    * Whether an user gesture would be required to start media playback or load
+    * media. This is off by default, so media playback could start
+    * automatically. Setting it on requires a gesture by the user to start
+    * playback, or to load the media.
+    *
+    * Since: 1.10.0
+    */
+    g_object_class_install_property(gobject_class,
+                                    PROP_MEDIA_PLAYBACK_REQUIRES_USER_GESTURE,
+                                    g_param_spec_boolean("media-playback-requires-user-gesture",
+                                                         _("Media playback requires user gesture"),
+                                                         _("Whether media playback requires user gesture"),
+                                                         FALSE,
+                                                         flags));
 }
 
 static void webkit_web_settings_init(WebKitWebSettings* web_settings)
@@ -1150,6 +1169,9 @@ static void webkit_web_settings_set_property(GObject* object, guint prop_id, con
     case PROP_ENABLE_SMOOTH_SCROLLING:
         priv->enableSmoothScrolling = g_value_get_boolean(value);
         break;
+    case PROP_MEDIA_PLAYBACK_REQUIRES_USER_GESTURE:
+        priv->mediaPlaybackRequiresUserGesture = g_value_get_boolean(value);
+        break;
     default:
         G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
         break;
@@ -1318,6 +1340,9 @@ static void webkit_web_settings_get_property(GObject* object, guint prop_id, GVa
     case PROP_ENABLE_SMOOTH_SCROLLING:
         g_value_set_boolean(value, priv->enableSmoothScrolling);
         break;
+    case PROP_MEDIA_PLAYBACK_REQUIRES_USER_GESTURE:
+        g_value_set_boolean(value, priv->mediaPlaybackRequiresUserGesture);
+        break;
     default:
         G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
         break;
index 45f8223..71eb83c 100644 (file)
@@ -81,6 +81,7 @@ struct _WebKitWebSettingsPrivate {
     gboolean enableWebAudio;
     gboolean enableAcceleratedCompositing;
     gboolean enableSmoothScrolling;
+    gboolean mediaPlaybackRequiresUserGesture;
 };
 
 WEBKIT_API void webkit_web_settings_add_extra_plugin_directory(WebKitWebView*, const gchar* directory);
index 5582092..a4d5f2b 100644 (file)
@@ -3384,6 +3384,7 @@ static void webkit_web_view_update_settings(WebKitWebView* webView)
     coreSettings->setJavaEnabled(settingsPrivate->enableJavaApplet);
     coreSettings->setHyperlinkAuditingEnabled(settingsPrivate->enableHyperlinkAuditing);
     coreSettings->setDNSPrefetchingEnabled(settingsPrivate->enableDNSPrefetching);
+    coreSettings->setMediaPlaybackRequiresUserGesture(settingsPrivate->mediaPlaybackRequiresUserGesture);
 
 #if ENABLE(SQL_DATABASE)
     AbstractDatabase::setIsAvailable(settingsPrivate->enableHTML5Database);
@@ -3522,6 +3523,8 @@ static void webkit_web_view_settings_notify(WebKitWebSettings* webSettings, GPar
         settings->setJavaEnabled(g_value_get_boolean(&value));
     else if (name == g_intern_string("enable-hyperlink-auditing"))
         settings->setHyperlinkAuditingEnabled(g_value_get_boolean(&value));
+    else if (name == g_intern_string("media-playback-requires-user-gesture"))
+        settings->setMediaPlaybackRequiresUserGesture(g_value_get_boolean(&value));
 
 #if ENABLE(SPELLCHECK)
     else if (name == g_intern_string("spell-checking-languages")) {
index 61eed93..e0950e0 100644 (file)
@@ -1,3 +1,17 @@
+2012-04-18  Simon Pena  <spena@igalia.com>
+
+        [GTK] r114021 triggered media flakyness
+        https://bugs.webkit.org/show_bug.cgi?id=83874
+
+        Reviewed by Philippe Normand.
+
+        Now that there is gtk API to update the
+        MediaPlaybackRequiresUserGesture property, set it to false from the
+        DumpRenderTree tool when resetting defaults to consistent values.
+
+        * DumpRenderTree/gtk/DumpRenderTree.cpp:
+        (resetDefaultsToConsistentValues):
+
 2012-04-18  Vivek Galatage  <vivekgalatage@gmail.com>
 
         Web Inspector: Disabling Inspector causes build failure on Windows
index 844555f..e349c6c 100644 (file)
@@ -427,6 +427,7 @@ static void resetDefaultsToConsistentValues()
                  "enable-hyperlink-auditing", FALSE,
                  "editing-behavior", WEBKIT_EDITING_BEHAVIOR_UNIX,
                  "enable-fullscreen", TRUE,
+                 "media-playback-requires-user-gesture", FALSE,
                  NULL);
     webkit_web_view_set_settings(webView, settings);
     webkit_set_cache_model(WEBKIT_CACHE_MODEL_DOCUMENT_BROWSER);