summaryrefslogtreecommitdiffstats
path: root/remote/test/puppeteer/packages/puppeteer-core/src/node/FirefoxLauncher.test.ts
blob: b0b1f812498af7a7fccdecca5f5cb192bc97e1c8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/**
 * @license
 * Copyright 2023 Google Inc.
 * SPDX-License-Identifier: Apache-2.0
 */

import {describe, it} from 'node:test';

import expect from 'expect';

import {FirefoxLauncher} from './FirefoxLauncher.js';

describe('FirefoxLauncher', function () {
  describe('getPreferences', function () {
    it('should return preferences for CDP', async () => {
      const prefs: Record<string, unknown> = FirefoxLauncher.getPreferences(
        {
          test: 1,
        },
        undefined
      );
      expect(prefs['test']).toBe(1);
      expect(prefs['fission.bfcacheInParent']).toBe(false);
      expect(prefs['fission.webContentIsolationStrategy']).toBe(0);
      expect(prefs).toEqual(
        FirefoxLauncher.getPreferences(
          {
            test: 1,
          },
          'cdp'
        )
      );
    });

    it('should return preferences for WebDriver BiDi', async () => {
      const prefs: Record<string, unknown> = FirefoxLauncher.getPreferences(
        {
          test: 1,
        },
        'webDriverBiDi'
      );
      expect(prefs['test']).toBe(1);
      expect(prefs['fission.bfcacheInParent']).toBe(undefined);
      expect(prefs['fission.webContentIsolationStrategy']).toBe(0);
    });
  });
});