API Test broken: TestWebKitAPI.WebKit2.GetUserMediaReprompt
authoryouenn@apple.com <youenn@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 1 Feb 2019 17:45:22 +0000 (17:45 +0000)
committeryouenn@apple.com <youenn@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 1 Feb 2019 17:45:22 +0000 (17:45 +0000)
https://bugs.webkit.org/show_bug.cgi?id=194155

Reviewed by Eric Carlson.

* TestWebKitAPI/Tests/WebKit/getUserMedia.html:
Revert use of async functions as it seems it cannot be evaluated from TestWebKitAPI.
Keep calling enumerateDevices to continue cover https://bugs.webkit.org/show_bug.cgi?id=194106.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@240856 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WebKit/getUserMedia.html

index fa05746..04e8bbb 100644 (file)
@@ -1,3 +1,14 @@
+2019-02-01  Youenn Fablet  <youenn@apple.com>
+
+        API Test broken: TestWebKitAPI.WebKit2.GetUserMediaReprompt
+        https://bugs.webkit.org/show_bug.cgi?id=194155
+
+        Reviewed by Eric Carlson.
+
+        * TestWebKitAPI/Tests/WebKit/getUserMedia.html:
+        Revert use of async functions as it seems it cannot be evaluated from TestWebKitAPI.
+        Keep calling enumerateDevices to continue cover https://bugs.webkit.org/show_bug.cgi?id=194106.
+
 2019-02-01  Zalan Bujtas  <zalan@apple.com>
 
         [LFC] Adjust replaced element's intrinsic ratio
index d72ce80..4bc074b 100644 (file)
@@ -5,16 +5,15 @@
 
             let stream = null;
 
-            async function promptForCapture()
+            function promptForCapture()
             {
-                try {
-                    await navigator.mediaDevices.enumerateDevices();
-                    const stream = await navigator.mediaDevices.getUserMedia({ audio: false, video: true })
+                navigator.mediaDevices.enumerateDevices().then(() => {
+                    return navigator.mediaDevices.getUserMedia({ audio: false, video: true })
+                }).then((s) => {
+                    stream = s;
                     video.srcObject = stream;
                     console.log("Got user media");
-                } catch(error) {
-                    console.log(`Failed with error: ${error}`);
-                }
+                }).catch((error) => console.log(`Failed with error: ${error}`));
             }
 
             function stop(kind)