SDA-4199 Add UT

This commit is contained in:
sbenmoussati 2023-07-04 15:21:18 +02:00 committed by Salah Benmoussati
parent 6e89cc39a2
commit a6fc4986fe

View File

@ -75,6 +75,12 @@ describe('chrome flags', () => {
expect(spy).nthCalledWith(4, 'disable-d3d11', true);
expect(spy).nthCalledWith(5, 'disable-gpu', true);
expect(spy).nthCalledWith(6, 'disable-gpu-compositing', true);
expect(spy).nthCalledWith(
7,
'enable-blink-features',
'RTCInsertableStreams',
);
expect(spy).nthCalledWith(8, 'disable-features', 'ChromeRootStoreUsed');
});
it('should call `setChromeFlags` correctly when `disableGpu` is false', () => {
@ -111,8 +117,8 @@ describe('chrome flags', () => {
});
const spy = jest.spyOn(app.commandLine, 'appendSwitch');
setChromeFlags();
expect(spy).nthCalledWith(6, 'disable-renderer-backgrounding', 'true');
expect(spy).not.nthCalledWith(7);
expect(spy).nthCalledWith(7, 'disable-renderer-backgrounding', 'true');
expect(spy).not.nthCalledWith(8);
});
it('should set `disable-renderer-backgrounding` chrome flag correctly when cloud config PMP setting is ENABLED', () => {
@ -123,8 +129,8 @@ describe('chrome flags', () => {
});
const spy = jest.spyOn(app.commandLine, 'appendSwitch');
setChromeFlags();
expect(spy).nthCalledWith(8, 'disable-renderer-backgrounding', 'true');
expect(spy).not.nthCalledWith(9);
expect(spy).nthCalledWith(9, 'disable-renderer-backgrounding', 'true');
expect(spy).not.nthCalledWith(10);
});
it('should set `disable-renderer-backgrounding` chrome flag when any one is ENABLED ', () => {
@ -145,8 +151,8 @@ describe('chrome flags', () => {
});
const spy = jest.spyOn(app.commandLine, 'appendSwitch');
setChromeFlags();
expect(spy).nthCalledWith(6, 'disable-renderer-backgrounding', 'true');
expect(spy).not.nthCalledWith(7);
expect(spy).nthCalledWith(7, 'disable-renderer-backgrounding', 'true');
expect(spy).not.nthCalledWith(8);
});
it('should set `disable-renderer-backgrounding` chrome flag when PMP is ENABLED', () => {
@ -167,8 +173,8 @@ describe('chrome flags', () => {
});
const spy = jest.spyOn(app.commandLine, 'appendSwitch');
setChromeFlags();
expect(spy).nthCalledWith(6, 'disable-renderer-backgrounding', 'true');
expect(spy).not.nthCalledWith(7);
expect(spy).nthCalledWith(7, 'disable-renderer-backgrounding', 'true');
expect(spy).not.nthCalledWith(8);
});
describe('`isDevEnv`', () => {