summaryrefslogtreecommitdiff
path: root/chromium/third_party/blink/renderer/modules/mediacapturefromelement/canvas_capture_handler_unittest.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/third_party/blink/renderer/modules/mediacapturefromelement/canvas_capture_handler_unittest.cc')
-rw-r--r--chromium/third_party/blink/renderer/modules/mediacapturefromelement/canvas_capture_handler_unittest.cc26
1 files changed, 26 insertions, 0 deletions
diff --git a/chromium/third_party/blink/renderer/modules/mediacapturefromelement/canvas_capture_handler_unittest.cc b/chromium/third_party/blink/renderer/modules/mediacapturefromelement/canvas_capture_handler_unittest.cc
index c08dece8a46..e4732c24b2f 100644
--- a/chromium/third_party/blink/renderer/modules/mediacapturefromelement/canvas_capture_handler_unittest.cc
+++ b/chromium/third_party/blink/renderer/modules/mediacapturefromelement/canvas_capture_handler_unittest.cc
@@ -228,6 +228,32 @@ TEST_P(CanvasCaptureHandlerTest, VerifyFrame) {
run_loop.RunUntilIdle();
}
+// Verifies that SkImage is processed and produces VideoFrame as expected.
+TEST_F(CanvasCaptureHandlerTest, DropAlphaDeliversOpaqueFrame) {
+ const int width = 2;
+ const int height = 2;
+ InSequence s;
+ media::VideoCapturerSource* const source = GetVideoCapturerSource(
+ static_cast<blink::MediaStreamVideoCapturerSource*>(
+ component_->Source()->GetPlatformSource()));
+ EXPECT_TRUE(source);
+
+ base::RunLoop run_loop;
+ EXPECT_CALL(*this, DoOnRunning(true)).Times(1);
+ media::VideoCaptureParams params;
+ source->SetCanDiscardAlpha(true);
+ source->StartCapture(
+ params,
+ base::BindRepeating(&CanvasCaptureHandlerTest::OnVerifyDeliveredFrame,
+ base::Unretained(this), /*opaque_frame=*/true, width,
+ height),
+ base::BindRepeating(&CanvasCaptureHandlerTest::OnRunning,
+ base::Unretained(this)));
+ canvas_capture_handler_->SendNewFrame(
+ GenerateTestImage(/*opaque_frame=*/false, width, height), nullptr);
+ run_loop.RunUntilIdle();
+}
+
// Checks that needsNewFrame() works as expected.
TEST_F(CanvasCaptureHandlerTest, CheckNeedsNewFrame) {
InSequence s;