Changeset 244935 in webkit


Ignore:
Timestamp:
May 3, 2019 4:13:31 PM (5 years ago)
Author:
youenn@apple.com
Message:

[iOS] set the default maximum camera count to 1 for enumerateDevices
https://bugs.webkit.org/show_bug.cgi?id=197566

Reviewed by Eric Carlson.

Source/WebKit:

The previous number for iOS was 2 as there is a front and a back camera.
Since we are by default setting deviceIds to "", it is better to just have one,
as it might confuse applications to have two devices with the same ID.

Covered by updated test.

  • UIProcess/UserMediaPermissionRequestManagerProxy.cpp:

(WebKit::UserMediaPermissionRequestManagerProxy::computeFilteredDeviceList):

LayoutTests:

  • fast/mediastream/get-user-media-device-id.html:
Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r244918 r244935  
     12019-05-03  Youenn Fablet  <youenn@apple.com>
     2
     3        [iOS] set the default maximum camera count to 1 for enumerateDevices
     4        https://bugs.webkit.org/show_bug.cgi?id=197566
     5
     6        Reviewed by Eric Carlson.
     7
     8        * fast/mediastream/get-user-media-device-id.html:
     9
    1102019-05-03  Youenn Fablet  <youenn@apple.com>
    211
  • trunk/LayoutTests/fast/mediastream/get-user-media-device-id.html

    r241489 r244935  
    1212        testRunner.setUserMediaPermission(true);
    1313
    14     promise_test((test) => {
    15         return navigator.mediaDevices.enumerateDevices()
    16             .then((devices) => {
    17                 devices.forEach((device) => {
    18                     assert_true(device.deviceId.length == 0 , "device.deviceId is empty before permission to capture");
    19                 });
    20             });
     14    promise_test(async (test) => {
     15        const devices = await navigator.mediaDevices.enumerateDevices();
     16        assert_true(devices.length <= 2, "before getting permission, at most 1 camera and 1 microphone are exposed");
     17        devices.forEach((device) => {
     18            assert_true(device.deviceId.length == 0 , "device.deviceId is empty before permission to capture");
     19        });
    2120    }, "Device IDs should be empty initially");
    22    
     21
    2322    promise_test((test) => {
    2423        return navigator.mediaDevices.getUserMedia({ audio:true, video:true })
  • trunk/Source/WebKit/ChangeLog

    r244932 r244935  
     12019-05-03  Youenn Fablet  <youenn@apple.com>
     2
     3        [iOS] set the default maximum camera count to 1 for enumerateDevices
     4        https://bugs.webkit.org/show_bug.cgi?id=197566
     5
     6        Reviewed by Eric Carlson.
     7
     8        The previous number for iOS was 2 as there is a front and a back camera.
     9        Since we are by default setting deviceIds to "", it is better to just have one,
     10        as it might confuse applications to have two devices with the same ID.
     11
     12        Covered by updated test.
     13
     14        * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
     15        (WebKit::UserMediaPermissionRequestManagerProxy::computeFilteredDeviceList):
     16
    1172019-05-03  Daniel Bates  <dabates@apple.com>
    218
  • trunk/Source/WebKit/UIProcess/UserMediaPermissionRequestManagerProxy.cpp

    r243899 r244935  
    538538Vector<CaptureDevice> UserMediaPermissionRequestManagerProxy::computeFilteredDeviceList(bool revealIdsAndLabels, const String& deviceIDHashSalt)
    539539{
    540 #if PLATFORM(IOS_FAMILY)
    541     static const int defaultMaximumCameraCount = 2;
    542 #else
    543540    static const int defaultMaximumCameraCount = 1;
    544 #endif
    545541    static const int defaultMaximumMicrophoneCount = 1;
    546542
Note: See TracChangeset for help on using the changeset viewer.