Title: [252156] trunk
Revision
252156
Author
jer.no...@apple.com
Date
2019-11-06 15:56:41 -0800 (Wed, 06 Nov 2019)

Log Message

Screen locks while watching previously-muted-then-unmuted video
https://bugs.webkit.org/show_bug.cgi?id=203906
<rdar://problem/55821375>

Reviewed by Eric Carlson.

Source/WebCore:

Test: media/video-unmuted-after-play-holds-sleep-assertion.html

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::setMuted):

LayoutTests:

* media/video-unmuted-after-play-holds-sleep-assertion-expected.txt: Added.
* media/video-unmuted-after-play-holds-sleep-assertion.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (252155 => 252156)


--- trunk/LayoutTests/ChangeLog	2019-11-06 23:53:42 UTC (rev 252155)
+++ trunk/LayoutTests/ChangeLog	2019-11-06 23:56:41 UTC (rev 252156)
@@ -1,3 +1,14 @@
+2019-11-06  Jer Noble  <jer.no...@apple.com>
+
+        Screen locks while watching previously-muted-then-unmuted video
+        https://bugs.webkit.org/show_bug.cgi?id=203906
+        <rdar://problem/55821375>
+
+        Reviewed by Eric Carlson.
+
+        * media/video-unmuted-after-play-holds-sleep-assertion-expected.txt: Added.
+        * media/video-unmuted-after-play-holds-sleep-assertion.html: Added.
+
 2019-11-06  Daniel Bates  <daba...@apple.com>
 
         Update SameSite tests for new semantics for empty and invalid SameSite attribute

Added: trunk/LayoutTests/media/video-unmuted-after-play-holds-sleep-assertion-expected.txt (0 => 252156)


--- trunk/LayoutTests/media/video-unmuted-after-play-holds-sleep-assertion-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/media/video-unmuted-after-play-holds-sleep-assertion-expected.txt	2019-11-06 23:56:41 UTC (rev 252156)
@@ -0,0 +1,11 @@
+
+RUN(video.src = "" "content/test"))
+EVENT(canplaythrough)
+RUN(video.play())
+EVENT(playing)
+EXPECTED (internals.elementIsBlockingDisplaySleep(video) == 'false') OK
+RUN(video.muted = false)
+EVENT(volumechange)
+EXPECTED (internals.elementIsBlockingDisplaySleep(video) == 'true') OK
+END OF TEST
+

Added: trunk/LayoutTests/media/video-unmuted-after-play-holds-sleep-assertion.html (0 => 252156)


--- trunk/LayoutTests/media/video-unmuted-after-play-holds-sleep-assertion.html	                        (rev 0)
+++ trunk/LayoutTests/media/video-unmuted-after-play-holds-sleep-assertion.html	2019-11-06 23:56:41 UTC (rev 252156)
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <title>video-muted-holds-sleep-assertion</title>
+    <script src=""
+    <script src=""
+    <script>
+    window.addEventListener('load', async event => {
+        findMediaElement();
+
+        run('video.src = "" "content/test")');
+        await waitFor(video, 'canplaythrough');
+
+        run('video.play()');
+        await waitFor(video, 'playing');
+
+        testExpected('internals.elementIsBlockingDisplaySleep(video)', false);
+        runWithKeyDown('video.muted = false');
+        await waitFor(video, 'volumechange');
+
+        testExpected('internals.elementIsBlockingDisplaySleep(video)', true);
+
+        endTest();
+    }, {once: true});
+    </script>
+</head>
+<body>
+    <video controls muted></video>
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (252155 => 252156)


--- trunk/Source/WebCore/ChangeLog	2019-11-06 23:53:42 UTC (rev 252155)
+++ trunk/Source/WebCore/ChangeLog	2019-11-06 23:56:41 UTC (rev 252156)
@@ -1,3 +1,16 @@
+2019-11-06  Jer Noble  <jer.no...@apple.com>
+
+        Screen locks while watching previously-muted-then-unmuted video
+        https://bugs.webkit.org/show_bug.cgi?id=203906
+        <rdar://problem/55821375>
+
+        Reviewed by Eric Carlson.
+
+        Test: media/video-unmuted-after-play-holds-sleep-assertion.html
+
+        * html/HTMLMediaElement.cpp:
+        (WebCore::HTMLMediaElement::setMuted):
+
 2019-11-06  Oriol Brufau  <obru...@igalia.com>
 
         Keep None value at the end of the ListStyleType enum

Modified: trunk/Source/WebCore/html/HTMLMediaElement.cpp (252155 => 252156)


--- trunk/Source/WebCore/html/HTMLMediaElement.cpp	2019-11-06 23:53:42 UTC (rev 252155)
+++ trunk/Source/WebCore/html/HTMLMediaElement.cpp	2019-11-06 23:56:41 UTC (rev 252156)
@@ -3817,6 +3817,7 @@
         scheduleUpdateMediaState();
 #endif
         m_mediaSession->canProduceAudioChanged();
+        updateSleepDisabling();
     }
 
     schedulePlaybackControlsManagerUpdate();
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to