Changeset 207827 in webkit
- Timestamp:
- Oct 25, 2016 10:34:07 AM (7 years ago)
- Location:
- trunk
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r207821 r207827 1 2016-10-25 Eric Carlson <eric.carlson@apple.com> 2 3 [MediaStream] Add "has capture device" bit to media state flags 4 https://bugs.webkit.org/show_bug.cgi?id=163952 5 6 Reviewed by Jer Noble. 7 8 * fast/mediastream/MediaStream-page-muted-expected.txt: 9 * fast/mediastream/MediaStream-page-muted.html: 10 * media/muted-video-is-playing-audio-expected.txt: 11 * media/muted-video-is-playing-audio.html: 12 1 13 2016-10-25 Brady Eidson <beidson@apple.com> 2 14 -
trunk/LayoutTests/fast/mediastream/MediaStream-page-muted-expected.txt
r207764 r207827 8 8 PASS mediaStream is an instance of Object 9 9 PASS mediaStream.getTracks().length is 2 10 PASS window.internals.pageMediaState().includes('HasActiveMediaCaptureDevice') became true 10 11 11 12 *** Muting capture devices 12 13 EVENT: mute 13 PASS event.target.muted is true 14 PASS muteChangedEvent.target.muted is true 15 PASS window.internals.pageMediaState().includes('HasMediaCaptureDevice') is true 16 EVENT: mute 17 PASS muteChangedEvent.target.muted is true 18 PASS window.internals.pageMediaState().includes('HasMediaCaptureDevice') is true 14 19 15 EVENT: mute 16 PASS event.target.muted is true 17 20 PASS window.internals.pageMediaState().includes('HasActiveMediaCaptureDevice') became false 18 21 19 22 *** Unmuting capture devices 20 23 EVENT: unmute 21 PASS event.target.muted is false 24 PASS muteChangedEvent.target.muted is false 25 PASS window.internals.pageMediaState().includes('HasMediaCaptureDevice') is true 26 EVENT: unmute 27 PASS muteChangedEvent.target.muted is false 28 PASS window.internals.pageMediaState().includes('HasMediaCaptureDevice') is true 22 29 23 EVENT: unmute 24 PASS event.target.muted is false 25 30 PASS window.internals.pageMediaState().includes('HasActiveMediaCaptureDevice') became true 26 31 PASS successfullyParsed is true 27 32 -
trunk/LayoutTests/fast/mediastream/MediaStream-page-muted.html
r207764 r207827 6 6 let mediaStream; 7 7 let eventCount = 0; 8 let muteChangedEvent; 9 10 function nextStep() 11 { 12 if (muteChangedEvent.type == "unmute") { 13 finishJSTest(); 14 return; 15 } 16 17 debug("<br>*** Unmuting capture devices"); 18 eventCount = 0; 19 internals.setPageMuted(""); 20 } 8 21 9 22 function muteChanged(ev) 10 23 { 11 event = ev;12 debug(`EVENT: ${ ev.type}`);13 shouldBe(' event.target.muted', (ev.type == "mute").toString());14 debug("");24 muteChangedEvent = ev; 25 debug(`EVENT: ${muteChangedEvent.type}`); 26 shouldBe('muteChangedEvent.target.muted', (muteChangedEvent.type == "mute").toString()); 27 shouldBe("window.internals.pageMediaState().includes('HasMediaCaptureDevice')", "true"); 15 28 16 29 if (++eventCount == 2) { 17 eventCount = 0; 18 19 if (ev.type == "unmute") { 20 finishJSTest(); 21 return; 22 } 23 24 if (window.internals) { 25 debug("<br>*** Unmuting capture devices"); 26 internals.setPageMuted(""); 27 } 30 debug(""); 31 let shouldBeActive = muteChangedEvent.type == "mute" ? "false" : "true"; 32 shouldBecomeEqual("window.internals.pageMediaState().includes('HasActiveMediaCaptureDevice')", shouldBeActive, nextStep); 28 33 } 34 } 35 36 function muteCaptureDevices() 37 { 38 debug("<br>*** Muting capture devices"); 39 internals.setPageMuted("capturedevices"); 29 40 } 30 41 … … 44 55 } 45 56 46 if (window.internals) { 47 debug("<br>*** Muting capture devices"); 48 internals.setPageMuted("capturedevices"); 49 } 57 shouldBecomeEqual("window.internals.pageMediaState().includes('HasActiveMediaCaptureDevice')", "true", muteCaptureDevices); 50 58 }) 51 59 .catch((err) => { -
trunk/LayoutTests/media/muted-video-is-playing-audio-expected.txt
r178655 r207827 4 4 5 5 6 PASS window.internals. isPagePlayingAudio() became true7 PASS window.internals. isPagePlayingAudio() became false8 PASS window.internals. isPagePlayingAudio() became true6 PASS window.internals.pageMediaState().includes('IsPlayingAudio') became true 7 PASS window.internals.pageMediaState().includes('IsPlayingAudio') became false 8 PASS window.internals.pageMediaState().includes('IsPlayingAudio') became true 9 9 PASS successfullyParsed is true 10 10 -
trunk/LayoutTests/media/muted-video-is-playing-audio.html
r178655 r207827 16 16 { 17 17 run("video.muted = false"); 18 shouldBecomeEqual("window.internals. isPagePlayingAudio()", "true", finishJSTest);18 shouldBecomeEqual("window.internals.pageMediaState().includes('IsPlayingAudio')", "true", finishJSTest); 19 19 } 20 20 … … 22 22 { 23 23 run("video.muted = true"); 24 shouldBecomeEqual("window.internals. isPagePlayingAudio()", "false", testUnmutingVideo);24 shouldBecomeEqual("window.internals.pageMediaState().includes('IsPlayingAudio')", "false", testUnmutingVideo); 25 25 } 26 26 27 shouldBecomeEqual("window.internals. isPagePlayingAudio()", "true", testMutingVideo);27 shouldBecomeEqual("window.internals.pageMediaState().includes('IsPlayingAudio')", "true", testMutingVideo); 28 28 </script> 29 29 <script src="../resources/js-test-post.js"></script> -
trunk/Source/WebCore/ChangeLog
r207821 r207827 1 2016-10-25 Eric Carlson <eric.carlson@apple.com> 2 3 [MediaStream] Add "has capture device" bit to media state flags 4 https://bugs.webkit.org/show_bug.cgi?id=163952 5 6 Reviewed by Jer Noble. 7 8 No new tests, updated fast/mediastream/MediaStream-page-muted.html and media/muted-video-is-playing-audio.html. 9 10 * Modules/mediastream/MediaStream.cpp: 11 (WebCore::MediaStream::mediaState): Set HasMediaCaptureDevice, only set HasActiveMediaCaptureDevice when 12 actually producing data. 13 14 * page/MediaProducer.h: Add HasMediaCaptureDevice bit. 15 16 * testing/Internals.cpp: 17 (WebCore::Internals::pageMediaState): Return a string representing MediaStateFlags. 18 (WebCore::Internals::isPagePlayingAudio): Deleted. 19 * testing/Internals.h: 20 * testing/Internals.idl: 21 1 22 2016-10-25 Brady Eidson <beidson@apple.com> 2 23 -
trunk/Source/WebCore/Modules/mediastream/MediaStream.cpp
r207764 r207827 275 275 return state; 276 276 277 if (m_externallyMuted || m_private->isProducingData()) 277 state |= HasMediaCaptureDevice; 278 if (m_private->isProducingData()) 278 279 state |= HasActiveMediaCaptureDevice; 279 280 -
trunk/Source/WebCore/page/MediaProducer.h
r207764 r207827 45 45 HasAudioOrVideo = 1 << 10, 46 46 HasActiveMediaCaptureDevice = 1 << 11, 47 HasMediaCaptureDevice = 1 << 12, 47 48 }; 48 49 typedef unsigned MediaStateFlags; -
trunk/Source/WebCore/testing/Internals.cpp
r207764 r207827 2967 2967 } 2968 2968 2969 bool Internals::isPagePlayingAudio()2969 String Internals::pageMediaState() 2970 2970 { 2971 2971 Document* document = contextDocument(); 2972 2972 if (!document || !document->page()) 2973 return false; 2974 2975 return !!(document->page()->mediaState() & MediaProducer::IsPlayingAudio); 2973 return emptyString(); 2974 2975 WebCore::MediaProducer::MediaStateFlags state = document->page()->mediaState(); 2976 StringBuilder string; 2977 if (state & MediaProducer::IsPlayingAudio) 2978 string.append("IsPlayingAudio,"); 2979 if (state & MediaProducer::IsPlayingVideo) 2980 string.append("IsPlayingVideo,"); 2981 if (state & MediaProducer::IsPlayingToExternalDevice) 2982 string.append("IsPlayingToExternalDevice,"); 2983 if (state & MediaProducer::RequiresPlaybackTargetMonitoring) 2984 string.append("RequiresPlaybackTargetMonitoring,"); 2985 if (state & MediaProducer::ExternalDeviceAutoPlayCandidate) 2986 string.append("ExternalDeviceAutoPlayCandidate,"); 2987 if (state & MediaProducer::DidPlayToEnd) 2988 string.append("DidPlayToEnd,"); 2989 if (state & MediaProducer::IsSourceElementPlaying) 2990 string.append("IsSourceElementPlaying,"); 2991 2992 if (state & MediaProducer::IsNextTrackControlEnabled) 2993 string.append("IsNextTrackControlEnabled,"); 2994 if (state & MediaProducer::IsPreviousTrackControlEnabled) 2995 string.append("IsPreviousTrackControlEnabled,"); 2996 2997 if (state & MediaProducer::HasPlaybackTargetAvailabilityListener) 2998 string.append("HasPlaybackTargetAvailabilityListener,"); 2999 if (state & MediaProducer::HasAudioOrVideo) 3000 string.append("HasAudioOrVideo,"); 3001 if (state & MediaProducer::HasActiveMediaCaptureDevice) 3002 string.append("HasActiveMediaCaptureDevice,"); 3003 if (state & MediaProducer::HasMediaCaptureDevice) 3004 string.append("HasMediaCaptureDevice,"); 3005 3006 if (string.isEmpty()) 3007 string.append("IsNotPlaying"); 3008 else 3009 string.resize(string.length() - 1); 3010 3011 return string.toString(); 2976 3012 } 2977 3013 -
trunk/Source/WebCore/testing/Internals.h
r207764 r207827 442 442 443 443 void setPageMuted(const String&); 444 bool isPagePlayingAudio();444 String pageMediaState(); 445 445 446 446 void setPageDefersLoading(bool); -
trunk/Source/WebCore/testing/Internals.idl
r207764 r207827 419 419 420 420 void setPageMuted(DOMString mutedState); 421 boolean isPagePlayingAudio();421 DOMString pageMediaState(); 422 422 423 423 void setPageDefersLoading(boolean defersLoading);
Note: See TracChangeset
for help on using the changeset viewer.