Bug 152197 - [MediaStream] Add a setting to allow the mock media capture devices to be enabled and disabled
Summary: [MediaStream] Add a setting to allow the mock media capture devices to be ena...
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Eric Carlson
Depends on:
Reported: 2015-12-11 16:01 PST by Eric Carlson
Modified: 2015-12-11 17:53 PST (History)
1 user (show)

See Also:

Proposed patch. (22.91 KB, patch)
2015-12-11 16:14 PST, Eric Carlson
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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);


> 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.