Skip to content

Commit

Permalink
Merge pull request #344 from ringcentral/wp/release/0.8.10
Browse files Browse the repository at this point in the history
Wp/release/0.8.10
  • Loading branch information
nerdchacha authored May 19, 2022
2 parents ba97715 + cd2b50e commit 74194eb
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 17 deletions.
15 changes: 15 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "pwa-chrome",
"request": "launch",
"name": "Launch Chrome against localhost",
"url": "http://localhost:9090",
"webRoot": "${workspaceFolder}"
}
]
}
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ringcentral-web-phone",
"version": "0.8.9",
"version": "0.8.10",
"scripts": {
"test": "npm run test:ut && npm run test:e2e",
"test:coverage": "cat .coverage/lcov.info | coveralls -v",
Expand All @@ -24,7 +24,7 @@
"@types/expect-puppeteer": "3.3.1",
"@types/jest": "24.0.15",
"@types/jest-environment-puppeteer": "4.0.0",
"@types/node": "12.0.8",
"@types/node": "17.0.32",
"bootstrap": "3.4.1",
"cache-loader": "4.0.0",
"copy-webpack-plugin": "5.0.3",
Expand Down
20 changes: 10 additions & 10 deletions src/mediaStreams.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class Navigator {
}
}

global['navigator'] = new Navigator();
global.navigator = new Navigator() as any;

class FadeSessionDescriptionHandler {
public label;
Expand Down Expand Up @@ -242,7 +242,7 @@ class FadePeerConnection {
return new Promise((resolve, reject) => {
if (global['navigator'].userAgent === 'Chrome') {
resolve(this.chromeStats);
} else if (global['navigator'].userAgent === global['navigator'].firefox) {
} else if (global['navigator'].userAgent === (global.navigator as any).firefox) {
resolve(this.firefoxStats);
} else {
reject('unknown browser');
Expand Down Expand Up @@ -720,7 +720,7 @@ test('test getMediaStats in MediaStreamsImpl - mediaStatsTimerCallback - if (!p
});

test('test getRTPReport in MediaStreamsImpl -- session.mediaStreams.onRTPStat', async () => {
global['navigator'].userAgent = global['navigator'].chrome;
(global.navigator as any).userAgent = (global.navigator as any).chrome;
const fadeSession = new FadeSession();
var mediaStreams = new MediaStreamsImpl(fadeSession);
const pc = fadeSession.sessionDescriptionHandler.peerConnection;
Expand All @@ -732,7 +732,7 @@ test('test getRTPReport in MediaStreamsImpl -- session.mediaStreams.onRTPStat',
});

test('test getRTPReport in MediaStreamsImpl-- session.onRTPStat', async () => {
global['navigator'].userAgent = global['navigator'].chrome;
(global.navigator as any).userAgent = (global.navigator as any).chrome;
const fadeSession = new FadeSession();
var mediaStreams = new MediaStreamsImpl(fadeSession);
const pc = fadeSession.sessionDescriptionHandler.peerConnection;
Expand All @@ -744,7 +744,7 @@ test('test getRTPReport in MediaStreamsImpl-- session.onRTPStat', async () => {
});

test('test getRTPReport in MediaStreamsImpl-- session.on("rtpStat")', async () => {
global['navigator'].userAgent = global['navigator'].chrome;
(global.navigator as any).userAgent = (global.navigator as any).chrome;
const fadeSession = new FadeSession();
var mediaStreams = new MediaStreamsImpl(fadeSession);
const pc = fadeSession.sessionDescriptionHandler.peerConnection;
Expand All @@ -759,7 +759,7 @@ test('test getRTPReport in MediaStreamsImpl-- session.on("rtpStat")', async ()
});

test('test getRTPReport in MediaStreamsImpl -- verify chrome and safari', async () => {
global['navigator'].userAgent = global['navigator'].chrome;
(global.navigator as any).userAgent = (global.navigator as any).chrome;
const fadeSession = new FadeSession();
var mediaStreams = new MediaStreamsImpl(fadeSession);
const pc = fadeSession.sessionDescriptionHandler.peerConnection;
Expand All @@ -784,7 +784,7 @@ test('test getRTPReport in MediaStreamsImpl -- verify chrome and safari', async
});

test('test getRTPReport in MediaStreamsImpl -- verify firefox', async () => {
global['navigator'].userAgent = global['navigator'].firefox;
(global.navigator as any).userAgent = (global.navigator as any).firefox;
const fadeSession = new FadeSession();
var mediaStreams = new MediaStreamsImpl(fadeSession);
const pc = fadeSession.sessionDescriptionHandler.peerConnection;
Expand All @@ -809,7 +809,7 @@ test('test getRTPReport in MediaStreamsImpl -- verify firefox', async () => {
});

test('test getRTPReport in MediaStreamsImpl -- unknow browser and fail to get the statistics', async () => {
global['navigator'].userAgent = 'unknow';
(global.navigator as any).userAgent = 'unknow';
const fadeSession = new FadeSession();
var mediaStreams = new MediaStreamsImpl(fadeSession);
const pc = fadeSession.sessionDescriptionHandler.peerConnection;
Expand All @@ -827,7 +827,7 @@ test('test getRTPReport in MediaStreamsImpl -- test web browser() type', async (
const fadeSession = new FadeSession();
const mediaStreams = new MediaStreamsImpl(fadeSession);
for (const i in Browsers) {
global['navigator'].userAgent = i;
(global.navigator as any).userAgent = i;
expect(mediaStreams.browser()).toEqual(Browsers[i]);
}
mediaStreams.release();
Expand Down Expand Up @@ -862,7 +862,7 @@ test('test MediaStreamsImpl and getMediaStats -- release with stopMediaStat', as
});

test('test MediaStreamsImpl and getMediaStats -- opera', async () => {
global['navigator'].userAgent = global['navigator'].opera;
(global.navigator as any).userAgent = (global.navigator as any).opera;
const fadeSession = new FadeSession();
const mediaStreams = new MediaStreamsImpl(fadeSession);
expect(RTPReport).not.toBeNull();
Expand Down
3 changes: 2 additions & 1 deletion src/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,8 @@ async function sendReinvite(this: WebPhoneSession, options: any = {}): Promise<a
body: description,
receiveResponse: (response: IncomingResponse) => {
if (response.statusCode === 200) resolve(response);
}
},
extraHeaders: ["Contact: " + this.contact]
});
});
await this.receiveReinviteResponse(result);
Expand Down

0 comments on commit 74194eb

Please sign in to comment.