Skip to content

Commit

Permalink
Merge branch 'gh-pages' into multiple-scp
Browse files Browse the repository at this point in the history
  • Loading branch information
fippo authored Jul 4, 2024
2 parents fa718e5 + 2b86c32 commit 7e1ba8c
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/interop-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
matrix:
browserA: [chrome, firefox]
browserB: [firefox, chrome]
bver: ['unstable']
bver: [unstable]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
Expand Down
5 changes: 2 additions & 3 deletions src/content/getusermedia/gum/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,9 @@ function handleSuccess(stream) {

function handleError(error) {
if (error.name === 'OverconstrainedError') {
const v = constraints.video;
errorMsg(`The resolution ${v.width.exact}x${v.height.exact} px is not supported by your device.`);
errorMsg(`OverconstrainedError: The constraints could not be satisfied by the available devices. Constraints: ${JSON.stringify(constraints)}`);
} else if (error.name === 'NotAllowedError') {
errorMsg('Permissions have not been granted to use your camera and ' +
errorMsg('NotAllowedError: Permissions have not been granted to use your camera and ' +
'microphone, you need to allow the page access to your devices in ' +
'order for the demo to work.');
}
Expand Down
6 changes: 4 additions & 2 deletions src/content/peerconnection/dtmf/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,9 @@ function dtmfOnToneChange(tone) {
}

function sendTones(tones) {
if (dtmfSender && dtmfSender.canInsertDTMF) {
// firefox doesn't implement canInsertDTMF, so assume it's always available
// Ref: https://bugzilla.mozilla.org/show_bug.cgi?id=1623193
if (dtmfSender && (typeof (dtmfSender.canInsertDTMF) === 'undefined' || dtmfSender.canInsertDTMF)) {
const duration = durationInput.value;
const gap = gapInput.value;
console.log('Tones, duration, gap: ', tones, duration, gap);
Expand All @@ -193,4 +195,4 @@ function addDialPadHandlers() {
}
}

main();
main();
6 changes: 3 additions & 3 deletions test/download-browsers.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
const {buildDriver} = require('./webdriver');
// Download the browser(s).
async function download() {
if (process.env.browserA && process.env.browserB) {
(await buildDriver(process.env.browserA)).quit();
(await buildDriver(process.env.browserB)).quit();
if (process.env.BROWSER_A && process.env.BROWSER_B) {
(await buildDriver(process.env.BROWSER_A)).quit();
(await buildDriver(process.env.BROWSER_B)).quit();
} else {
(await buildDriver()).quit();
}
Expand Down
17 changes: 15 additions & 2 deletions test/webdriver.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,23 @@ if (os.platform() === 'win32') {
process.env.PATH += ':node_modules/.bin';
}

function mapVersion(browser, version) {
const versionMap = {
chrome: {
unstable: 'dev',
},
firefox: {
unstable: 'nightly',
}
};
return (versionMap[browser] || {})[version] || version;
}

async function buildDriver(browser = process.env.BROWSER || 'chrome', options = {version: process.env.BVER}) {
const version = mapVersion(options.version);
const platform = puppeteerBrowsers.detectBrowserPlatform();

const buildId = await download(browser, options.version || 'stable',
const buildId = await download(browser, version || 'stable',
cacheDir, platform);

// Chrome options.
Expand Down Expand Up @@ -88,7 +101,7 @@ async function buildDriver(browser = process.env.BROWSER || 'chrome', options =

// Safari options.
const safariOptions = new safari.Options();
safariOptions.setTechnologyPreview(options.version === 'unstable');
safariOptions.setTechnologyPreview(version === 'unstable');

// Firefox options.
const firefoxOptions = new firefox.Options();
Expand Down

0 comments on commit 7e1ba8c

Please sign in to comment.