https://bugs.webkit.org/show_bug.cgi?id=156546
<rdar://problem/
25560877>
Reviewed by Jer Noble.
Source/WebCore:
Test: media/remote-control-command-is-user-gesture.html
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::didReceiveRemoteControlCommand): Increment/decrement
m_processingRemoteControlCommand around calling remote command method.
(WebCore::HTMLMediaElement::processingUserGesture): Return true if called while handling
a remote control command.
* html/HTMLMediaElement.h:
LayoutTests:
* media/remote-control-command-is-user-gesture-expected.txt: Added.
* media/remote-control-command-is-user-gesture.html: Added.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199515
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2016-04-13 Eric Carlson <eric.carlson@apple.com>
+
+ [iOS] remote command should be considered user events
+ https://bugs.webkit.org/show_bug.cgi?id=156546
+ <rdar://problem/25560877>
+
+ Reviewed by Jer Noble.
+
+ * media/remote-control-command-is-user-gesture-expected.txt: Added.
+ * media/remote-control-command-is-user-gesture.html: Added.
+
2016-04-13 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r199502 and r199511.
--- /dev/null
+Test that a remote control command is treated as a user gesture.
+
+
+RUN(internals.setMediaElementRestrictions(video, "RequireUserGestureForVideoRateChange"))
+* set video.src
+EVENT(loadedmetadata)
+
+* video.play() should fail
+RUN(video.play())
+EXPECTED (video.paused == 'true') OK
+
+* Send a play command, it should succeed.
+RUN(internals.postRemoteControlCommand('play'))
+
+EVENT(timeupdate)
+END OF TEST
+
--- /dev/null
+<html>
+ <head>
+ <script src="media-file.js"></script>
+ <script src="video-test.js"></script>
+ <script>
+
+ function start()
+ {
+ if (!window.internals) {
+ failTest('This test requires window.internals.');
+ return;
+ }
+
+ findMediaElement();
+
+ run('internals.setMediaElementRestrictions(video, "RequireUserGestureForVideoRateChange")');
+
+ waitForEvent('loadedmetadata', loadedmetadata, false, true, document)
+ waitForEventAndEnd('timeupdate')
+
+ consoleWrite('* set video.src');
+ video.src = findMediaFile('video', 'content/test');
+ }
+
+ function loadedmetadata()
+ {
+ consoleWrite('<br>* video.play() should fail ');
+ run('video.play()');
+ testExpected('video.paused', true);
+
+ consoleWrite('<br>* Send a play command, it should succeed.');
+ run("internals.postRemoteControlCommand('play')");
+ consoleWrite('');
+ }
+
+ </script>
+ </head>
+
+ <body onload="start()">
+ <p>Test that a remote control command is treated as a user gesture.</p>
+ <video controls></video>
+ </body>
+</html>
+2016-04-13 Eric Carlson <eric.carlson@apple.com>
+
+ [iOS] remote command should be considered user events
+ https://bugs.webkit.org/show_bug.cgi?id=156546
+ <rdar://problem/25560877>
+
+ Reviewed by Jer Noble.
+
+ Test: media/remote-control-command-is-user-gesture.html
+
+ * html/HTMLMediaElement.cpp:
+ (WebCore::HTMLMediaElement::didReceiveRemoteControlCommand): Increment/decrement
+ m_processingRemoteControlCommand around calling remote command method.
+ (WebCore::HTMLMediaElement::processingUserGesture): Return true if called while handling
+ a remote control command.
+ * html/HTMLMediaElement.h:
+
2016-04-13 Antonio Gomes <tonikitoo@webkit.org>
Non-resizable text field looks resizable
#include "ShadowRoot.h"
#include "TimeRanges.h"
#include "UserContentController.h"
+#include "UserGestureIndicator.h"
#include <limits>
#include <runtime/Uint8Array.h>
#include <wtf/CurrentTime.h>
{
LOG(Media, "HTMLMediaElement::didReceiveRemoteControlCommand(%p) - %i", this, static_cast<int>(command));
+ UserGestureIndicator remoteControlUserGesture(DefinitelyProcessingUserGesture, &document());
switch (command) {
case PlatformMediaSession::PlayCommand:
play();