Bug 152197

Summary: [MediaStream] Add a setting to allow the mock media capture devices to be enabled and disabled
Product: WebKit Reporter: Eric Carlson <eric.carlson>
Component: MediaAssignee: Eric Carlson <eric.carlson>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Proposed patch. none

Description Eric Carlson 2015-12-11 16:01:32 PST
Add a setting to allow the mock media capture devices to be enabled and disabled
Comment 1 Eric Carlson 2015-12-11 16:14:45 PST
Created attachment 267201 [details]
Proposed patch.
Comment 2 Dean Jackson 2015-12-11 16:39:02 PST
Comment on attachment 267201 [details]
Proposed patch.

View in context: https://bugs.webkit.org/attachment.cgi?id=267201&action=review

> Source/WebKit2/UIProcess/API/C/WKPreferences.cpp:1432
> -void WKPreferencesSetResourceUsageOverlayVisible(WKPreferencesRef preferencesRef, bool javaEnabled)
> +void WKPreferencesSetResourceUsageOverlayVisible(WKPreferencesRef preferencesRef, bool enabled)
>  {
> -    toImpl(preferencesRef)->setResourceUsageOverlayVisible(javaEnabled);
> +    toImpl(preferencesRef)->setResourceUsageOverlayVisible(enabled);

Nice!

> LayoutTests/fast/mediastream/mock-media-source.html:17
> +                debug(`<br>*** Disable mock capture devices`);
> +                if (window.internals)
> +                    evalAndLog(`internals.setMockMediaCaptureDevicesEnabled(false)`);
> +                navigator.mediaDevices
> +                    .getUserMedia({audio:{}, video:{}})
> +                    .then(function(stream) {
> +                        mediaStream = stream;
> +                        testFailed(`mediaDevices.getUserMedia() succeeded when no devices should be available`);

Not a suggestion to fix, but I don't like the way the backtick looks, so I use regular quotes if I don't have any of the ${} stuff.
Comment 3 WebKit Commit Bot 2015-12-11 17:52:17 PST
The commit-queue encountered the following flaky tests while processing attachment 267201 [details]:

transitions/default-timing-function.html bug 138901 (author: simon.fraser@apple.com)
http/tests/media/media-source/mediasource-append-buffer.html bug 152206 (author: jer.noble@apple.com)
The commit-queue is continuing to process your patch.
Comment 4 WebKit Commit Bot 2015-12-11 17:53:06 PST
Comment on attachment 267201 [details]
Proposed patch.

Clearing flags on attachment: 267201

Committed r194000: <http://trac.webkit.org/changeset/194000>
Comment 5 WebKit Commit Bot 2015-12-11 17:53:09 PST
All reviewed patches have been landed.  Closing bug.