Documentation
¶
Overview ¶
Package capturefromelement provides common code for WebRTC's captureStream() tests; this API is used for <video> and <canvas> capture, see e.g. https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/captureStream and https://w3c.github.io/mediacapture-fromelement/.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DataFiles ¶
func DataFiles() []string
DataFiles returns a list of files required to run the tests in this package.
func RunCaptureStream ¶
func RunCaptureStream(ctx context.Context, s *testing.State, cr *chrome.Chrome, source CanvasSource, measurementDuration time.Duration) error
RunCaptureStream drives the code verifying the captureStream() functionality. measurementDuration, if != 0, specifies the time to collect performance metrics; conversely if == 0 the test instructs JS code to verify the capture correctness and finishes immediately.
Types ¶
type CanvasSource ¶
type CanvasSource int
CanvasSource defines what is fed to the <canvas> that we can capture from.
const ( // UseGlClearColor indicates flipping colours using WebGL's clearColor(). UseGlClearColor CanvasSource = iota // UseVideo indicates using a GetUserMedia() captured stream as canvas source. UseVideo )