Testing WebRTC applications
测试WebRTC应用程序
When writing automated tests for your WebRTC applications, there are useful configurations that can be enabled for browsers that make development and testing easier.
在为WebRTC应用程序编写自动测试时,可以为浏览器启用一些有用的配置,使开发和测试更容易。
Chrome
When running automated tests on Chrome, the following arguments are useful when launching:
在Chrome上运行自动测试时,以下参数在启动时很有用:
--allow-file-access-from-files
- Allows API access for file:// URLs--allow-file-access-from-files
-允许API访问file:// URLs--disable-translate
- Disables the translation popup--disable-translate-禁用翻译弹出窗口
--use-fake-ui-for-media-stream
- Provide fake media streams. Useful when running on CI servers.--use-fake-ui-for-media-stream-提供虚假媒体流。在CI服务器上运行时很有用。
--use-file-for-fake-audio-capture=<filename>
- Provide a file to use when capturing audio.--use-file-for-fake-audio-capture=<filename>-提供一个在捕获音频时使用的文件。
--use-file-for-fake-video-capture=<filename>
- Provide a file to use when capturing video.--use-file-for-fake-video-capture=<filename>-提供一个在拍摄视频时使用的文件。
--headless
- Run in headless mode. Useful when running on CI servers.--headless-在无头模式下运行。在CI服务器上运行时很有用。
--mute-audio
- Mute audio output.--mute-audio-将音频输出静音。
Firefox
When running automated tests on Firefox, we need to provide a set of preference keys that will be used on the launched instance. Below is the configuration used for the WebRTC samples automated tests:
在Firefox上运行自动测试时,我们需要提供一组将在启动的实例上使用的首选项密钥。以下是用于WebRTC示例自动测试的配置:
"prefs": {
"browser.cache.disk.enable": false,
"browser.cache.disk.capacity": 0,
"browser.cache.disk.smart_size.enabled": false,
"browser.cache.disk.smart_size.first_run": false,
"browser.sessionstore.resume_from_crash": false,
"browser.startup.page": 0,
"media.navigator.streams.fake": true,
"media.navigator.permission.disabled": true,
"device.storage.enabled": false,
"media.gstreamer.enabled": false,
"browser.startup.homepage": "about:blank",
"browser.startup.firstrunSkipsHomepage": false,
"extensions.update.enabled": false,
"app.update.enabled": false,
"network.http.use-cache": false,
"browser.shell.checkDefaultBrowser": false
}