Skip to content

Commit

Permalink
[AUTO] Generate code by terra (#27)
Browse files Browse the repository at this point in the history
Co-authored-by: guoxianzhe <guoxianzhe@users.noreply.github.com>
  • Loading branch information
sda-rob and guoxianzhe authored Jan 26, 2024
1 parent 38fa489 commit a4ab06e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 36 deletions.
2 changes: 1 addition & 1 deletion packages/@iris/rtc/generate/IAgoraRtcEngine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1302,7 +1302,7 @@ export interface IVideoDeviceManager {

setDevice_4ad5f6e(deviceIdUTF8: string): CallApiReturnType;

getDevice_73b9872(deviceIdUTF8: string): CallApiReturnType;
getDevice_73b9872(): CallApiReturnType;

numberOfCapabilities_3a2037f(deviceIdUTF8: string): CallApiReturnType;

Expand Down
8 changes: 2 additions & 6 deletions packages/rtc/src/binding/IAgoraRtcEngineDispatch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1971,12 +1971,8 @@ export class IVideoDeviceManagerDispatch implements IVideoDeviceManager {
}

// @ts-ignore
getDevice_73b9872(apiParam: ApiParam): CallApiReturnType {
let obj = JSON.parse(apiParam.data) as any;
let deviceIdUTF8 = obj.deviceIdUTF8;
if (deviceIdUTF8 === undefined) throw 'deviceIdUTF8 is undefined';

return this._impl.getDevice_73b9872(deviceIdUTF8);
getDevice_73b9872(): CallApiReturnType {
return this._impl.getDevice_73b9872();
}

// @ts-ignore
Expand Down
31 changes: 2 additions & 29 deletions packages/rtc/test/binding/IAgoraRtcEngineDispatch.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2487,41 +2487,14 @@ describe('IVideoDeviceManager', () => {
).toBeCalledWith('test');
});

test('VideoDeviceManager_getDevice_73b9872 parameter', async () => {
let nParam = {
deviceIdUTF8: undefined,
};
for (let i in nParam) {
try {
await IrisCore.callIrisApi(
apiEnginePtr,
new IrisCore.EventParam(
'VideoDeviceManager_getDevice_73b9872',
JSON.stringify(nParam),
0,
'',
['test'],
[],
1
)
);
} catch (e) {
expect(e).toEqual(i + ' is undefined');
}
nParam[i] = 'test';
}
});

test('VideoDeviceManager_getDevice_73b9872 impl call', async () => {
jest
.spyOn(
irisRtcEngine.implDispatchesMap.get('VideoDeviceManager')._impl,
'getDevice_73b9872'
)
.mockResolvedValue(new CallIrisApiResult(0, ''));
let nParam = {
deviceIdUTF8: 'test',
};
let nParam = {};
let apiParam = new IrisCore.EventParam(
'VideoDeviceManager_getDevice_73b9872',
JSON.stringify(nParam),
Expand All @@ -2539,7 +2512,7 @@ describe('IVideoDeviceManager', () => {
expect(
irisRtcEngine.implDispatchesMap.get('VideoDeviceManager')._impl
.getDevice_73b9872
).toBeCalledWith('test');
).toBeCalledWith();
});

test('VideoDeviceManager_numberOfCapabilities_3a2037f impl call', async () => {
Expand Down

0 comments on commit a4ab06e

Please sign in to comment.