Bug 220347 - Stop using MediaRecorder in API test WebKit2.SpeechRecognitionErrorWhenStartingAudioCaptureOnDifferentPage
Summary: Stop using MediaRecorder in API test WebKit2.SpeechRecognitionErrorWhenStarti...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Sihui Liu
URL:
Keywords: InRadar
: 220425 (view as bug list)
Depends on:
Blocks:
 
Reported: 2021-01-05 16:59 PST by Sihui Liu
Modified: 2021-01-08 11:57 PST (History)
3 users (show)

See Also:


Attachments
Patch (2.10 KB, patch)
2021-01-05 17:01 PST, Sihui Liu
no flags Details | Formatted Diff | Diff
Patch (4.41 KB, patch)
2021-01-06 10:44 PST, Sihui Liu
no flags Details | Formatted Diff | Diff
Patch for landing (4.49 KB, patch)
2021-01-08 09:44 PST, Sihui Liu
no flags Details | Formatted Diff | Diff
Patch for landing (4.23 KB, patch)
2021-01-08 09:45 PST, Sihui Liu
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sihui Liu 2021-01-05 16:59:23 PST
...
Comment 1 Sihui Liu 2021-01-05 17:01:05 PST
Created attachment 417057 [details]
Patch
Comment 2 youenn fablet 2021-01-06 09:37:07 PST
Comment on attachment 417057 [details]
Patch

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

> Tools/TestWebKitAPI/Tests/WebKitCocoa/SpeechRecognition.mm:130
> +    for (_WKExperimentalFeature *feature in [WKPreferences _experimentalFeatures]) {

It might be best to not use media recorder or to make the test work in both cases (MediaRecorder on or off).
WTR can use MediaRecorder with a mock backend in all platforms but the real backend is only supported for recent MacOS versions.
Comment 3 Sihui Liu 2021-01-06 10:44:17 PST
Created attachment 417100 [details]
Patch
Comment 4 Sihui Liu 2021-01-07 09:00:10 PST
(In reply to youenn fablet from comment #2)
> Comment on attachment 417057 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=417057&action=review
> 
> > Tools/TestWebKitAPI/Tests/WebKitCocoa/SpeechRecognition.mm:130
> > +    for (_WKExperimentalFeature *feature in [WKPreferences _experimentalFeatures]) {
> 
> It might be best to not use media recorder or to make the test work in both
> cases (MediaRecorder on or off).
> WTR can use MediaRecorder with a mock backend in all platforms but the real
> backend is only supported for recent MacOS versions.

Removed media recorder and use audio element instead.
Comment 5 Sihui Liu 2021-01-07 12:07:29 PST
*** Bug 220425 has been marked as a duplicate of this bug. ***
Comment 6 youenn fablet 2021-01-08 00:12:32 PST
Comment on attachment 417100 [details]
Patch

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

> Tools/TestWebKitAPI/Tests/WebKitCocoa/SpeechRecognition.mm:34
> +#import <WebKit/_WKExperimentalFeature.h>

No longer needed.

> Tools/TestWebKitAPI/Tests/WebKitCocoa/speechrecognition-basic.html:32
> +        };

I would simplify this and just do:
audio.play();
It might be best also to add the audio element to the DOM.
Maybe just add something like:
<audio id="audio" autoplay></audio>
And then write audio.play() here.
Comment 7 Sihui Liu 2021-01-08 09:44:51 PST
Created attachment 417273 [details]
Patch for landing
Comment 8 Sihui Liu 2021-01-08 09:45:29 PST
Created attachment 417274 [details]
Patch for landing
Comment 9 EWS 2021-01-08 11:49:50 PST
Found 1 new test failure: media/controls/showControlsButton.html
Comment 10 EWS 2021-01-08 11:56:14 PST
Committed r271311: <https://trac.webkit.org/changeset/271311>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 417274 [details].
Comment 11 Radar WebKit Bug Importer 2021-01-08 11:57:15 PST
<rdar://problem/72938893>