Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AUTO] Generate code by terra #27

Merged
merged 1 commit into from
Jan 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading