Title: [292705] trunk/Tools
- Revision
- 292705
- Author
- [email protected]
- Date
- 2022-04-11 01:29:51 -0700 (Mon, 11 Apr 2022)
Log Message
Split TestWebKitAPI.GPUProcess.ExitsUnderMemoryPressureWebRTCCase in more tests
https://bugs.webkit.org/show_bug.cgi?id=238927
Reviewed by Eric Carlson.
Split the tests in sub tests (microphone, camera, camera+video codec).
* TestWebKitAPI/Tests/WebKit/getUserMedia.html:
* TestWebKitAPI/Tests/WebKitCocoa/GPUProcess.mm:
(TEST):
Modified Paths
Diff
Modified: trunk/Tools/ChangeLog (292704 => 292705)
--- trunk/Tools/ChangeLog 2022-04-11 07:51:31 UTC (rev 292704)
+++ trunk/Tools/ChangeLog 2022-04-11 08:29:51 UTC (rev 292705)
@@ -1,3 +1,16 @@
+2022-04-11 Youenn Fablet <[email protected]>
+
+ Split TestWebKitAPI.GPUProcess.ExitsUnderMemoryPressureWebRTCCase in more tests
+ https://bugs.webkit.org/show_bug.cgi?id=238927
+
+ Reviewed by Eric Carlson.
+
+ Split the tests in sub tests (microphone, camera, camera+video codec).
+
+ * TestWebKitAPI/Tests/WebKit/getUserMedia.html:
+ * TestWebKitAPI/Tests/WebKitCocoa/GPUProcess.mm:
+ (TEST):
+
2022-04-10 Chris Dumez <[email protected]>
Unreviewed, fix use of ASCIILiteral for a literal containing non-ASCII characters after r292251.
Modified: trunk/Tools/TestWebKitAPI/Tests/WebKit/getUserMedia.html (292704 => 292705)
--- trunk/Tools/TestWebKitAPI/Tests/WebKit/getUserMedia.html 2022-04-11 07:51:31 UTC (rev 292704)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit/getUserMedia.html 2022-04-11 08:29:51 UTC (rev 292705)
@@ -51,14 +51,22 @@
navigator.mediaDevices.getUserMedia({audio: true, video: true});
}
- function captureAudio()
+ function captureAudio(notifySuccess)
{
- navigator.mediaDevices.getUserMedia({audio: true}).then(s => stream = s);
+ navigator.mediaDevices.getUserMedia({audio: true}).then(s => {
+ if (notifySuccess)
+ window.webkit.messageHandlers.gum.postMessage("PASS");
+ stream = s;
+ });
}
- function captureVideo()
+ function captureVideo(notifySuccess)
{
- navigator.mediaDevices.getUserMedia({video: true}).then(s => video.srcObject = s);
+ navigator.mediaDevices.getUserMedia({video: true}).then(s => {
+ if (notifySuccess)
+ window.webkit.messageHandlers.gum.postMessage("PASS");
+ video.srcObject = s;
+ });
}
function captureAudioAndVideo(notifySuccess)
Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/GPUProcess.mm (292704 => 292705)
--- trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/GPUProcess.mm 2022-04-11 07:51:31 UTC (rev 292704)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/GPUProcess.mm 2022-04-11 08:29:51 UTC (rev 292705)
@@ -681,8 +681,7 @@
return false;
}
-// FIXME: https://bugs.webkit.org/show_bug.cgi?id=237854DISABLED_
-TEST(GPUProcess, DISABLED_ExitsUnderMemoryPressureWebRTCCase)
+TEST(GPUProcess, ExitsUnderMemoryPressureGetUserMediaAudioCase)
{
runMemoryPressureExitTest([](WKWebView *webView) {
auto delegate = adoptNS([[UserMediaCaptureUIDelegate alloc] init]);
@@ -690,7 +689,45 @@
[webView loadTestPageNamed:@"getUserMedia"];
EXPECT_TRUE(waitUntilCaptureState(webView, _WKMediaCaptureStateDeprecatedActiveCamera));
- [webView stringByEvaluatingJavaScript:@"captureAudioAndVideo(true)"];
+ [webView stringByEvaluatingJavaScript:@"captureAudio(true)"];
+ }, [](WKWebViewConfiguration* configuration) {
+ auto preferences = configuration.preferences;
+ preferences._mediaCaptureRequiresSecureConnection = NO;
+ configuration._mediaCaptureEnabled = YES;
+ preferences._mockCaptureDevicesEnabled = YES;
+ preferences._getUserMediaRequiresFocus = NO;
+ });
+}
+
+TEST(GPUProcess, ExitsUnderMemoryPressureGetUserMediaVideoCase)
+{
+ runMemoryPressureExitTest([](WKWebView *webView) {
+ auto delegate = adoptNS([[UserMediaCaptureUIDelegate alloc] init]);
+ webView.UIDelegate = delegate.get();
+
+ [webView loadTestPageNamed:@"getUserMedia"];
+ EXPECT_TRUE(waitUntilCaptureState(webView, _WKMediaCaptureStateDeprecatedActiveCamera));
+ [webView stringByEvaluatingJavaScript:@"captureVideo(true)"];
+ }, [](WKWebViewConfiguration* configuration) {
+ auto preferences = configuration.preferences;
+ preferences._mediaCaptureRequiresSecureConnection = NO;
+ configuration._mediaCaptureEnabled = YES;
+ preferences._mockCaptureDevicesEnabled = YES;
+ preferences._getUserMediaRequiresFocus = NO;
+ });
+}
+
+#if PLATFORM(MAC)
+// FIXME: https://bugs.webkit.org/show_bug.cgi?id=237854 is disabled for IOS
+TEST(GPUProcess, ExitsUnderMemoryPressureWebRTCCase)
+{
+ runMemoryPressureExitTest([](WKWebView *webView) {
+ auto delegate = adoptNS([[UserMediaCaptureUIDelegate alloc] init]);
+ webView.UIDelegate = delegate.get();
+
+ [webView loadTestPageNamed:@"getUserMedia"];
+ EXPECT_TRUE(waitUntilCaptureState(webView, _WKMediaCaptureStateDeprecatedActiveCamera));
+ [webView stringByEvaluatingJavaScript:@"captureVideo(true)"];
[webView stringByEvaluatingJavaScript:@"createConnection()"];
}, [](WKWebViewConfiguration* configuration) {
auto preferences = configuration.preferences;
@@ -700,6 +737,7 @@
preferences._getUserMediaRequiresFocus = NO;
});
}
+#endif // PLATFORM(MAC)
#endif // ENABLE(MEDIA_STREAM)
TEST(GPUProcess, ExitsUnderMemoryPressureWebAudioCase)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes