Commit 1f9f8e39 authored by fkilic's avatar fkilic Committed by Pier Angelo Vendrame
Browse files

Bug 1984333 - Spoof CPU cores to 4, or 8 if the machine has 8+ cores. r=timhuang

parent 8e0ec36b
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -10,7 +10,8 @@

"use strict";

const SPOOFED_HW_CONCURRENCY = 2;
const SPOOFED_HW_CONCURRENCY =
  SpecialPowers.Services.appinfo.OS == "Darwin" ? 8 : 4;

const DEFAULT_HARDWARE_CONCURRENCY = navigator.hardwareConcurrency;

@@ -27,6 +28,14 @@ async function testHWConcurrency(result, expectedResults, extraData) {
  );
}

add_setup(async function () {
  registerCleanupFunction(async function () {
    Services.prefs.clearUserPref(
      "privacy.trackingprotection.allow_list.hasUserInteractedWithETPSettings"
    );
  });
});

// The following are convenience objects that allow you to quickly see what is
//   and is not modified from a logical set of values.
// Be sure to always use `let expectedResults = structuredClone(allNotSpoofed)` to do a
+10 −1
Original line number Diff line number Diff line
@@ -20,7 +20,8 @@

"use strict";

const SPOOFED_HW_CONCURRENCY = 2;
const SPOOFED_HW_CONCURRENCY =
  SpecialPowers.Services.appinfo.OS == "Darwin" ? 8 : 4;

const DEFAULT_HARDWARE_CONCURRENCY = navigator.hardwareConcurrency;

@@ -37,6 +38,14 @@ async function testHWConcurrency(result, expectedResults, extraData) {
  );
}

add_setup(async function () {
  registerCleanupFunction(async function () {
    Services.prefs.clearUserPref(
      "privacy.trackingprotection.allow_list.hasUserInteractedWithETPSettings"
    );
  });
});

// The following are convenience objects that allow you to quickly see what is
//   and is not modified from a logical set of values.
// Be sure to always use `let expectedResults = structuredClone(allNotSpoofed)` to do a
+10 −1
Original line number Diff line number Diff line
@@ -20,7 +20,8 @@

"use strict";

const SPOOFED_HW_CONCURRENCY = 2;
const SPOOFED_HW_CONCURRENCY =
  SpecialPowers.Services.appinfo.OS == "Darwin" ? 8 : 4;

const DEFAULT_HARDWARE_CONCURRENCY = navigator.hardwareConcurrency;

@@ -37,6 +38,14 @@ async function testHWConcurrency(result, expectedResults, extraData) {
  );
}

add_setup(async function () {
  registerCleanupFunction(async function () {
    Services.prefs.clearUserPref(
      "privacy.trackingprotection.allow_list.hasUserInteractedWithETPSettings"
    );
  });
});

// The following are convenience objects that allow you to quickly see what is
//   and is not modified from a logical set of values.
// Be sure to always use `let expectedResults = structuredClone(allNotSpoofed)` to do a
+10 −1
Original line number Diff line number Diff line
@@ -20,7 +20,8 @@

"use strict";

const SPOOFED_HW_CONCURRENCY = 2;
const SPOOFED_HW_CONCURRENCY =
  SpecialPowers.Services.appinfo.OS == "Darwin" ? 8 : 4;

const DEFAULT_HARDWARE_CONCURRENCY = navigator.hardwareConcurrency;

@@ -37,6 +38,14 @@ async function testHWConcurrency(result, expectedResults, extraData) {
  );
}

add_setup(async function () {
  registerCleanupFunction(async function () {
    Services.prefs.clearUserPref(
      "privacy.trackingprotection.allow_list.hasUserInteractedWithETPSettings"
    );
  });
});

// The following are convenience objects that allow you to quickly see what is
//   and is not modified from a logical set of values.
// Be sure to always use `let expectedResults = structuredClone(allNotSpoofed)` to do a
+10 −1
Original line number Diff line number Diff line
@@ -20,7 +20,8 @@

"use strict";

const SPOOFED_HW_CONCURRENCY = 2;
const SPOOFED_HW_CONCURRENCY =
  SpecialPowers.Services.appinfo.OS == "Darwin" ? 8 : 4;

const DEFAULT_HARDWARE_CONCURRENCY = navigator.hardwareConcurrency;

@@ -37,6 +38,14 @@ async function testHWConcurrency(result, expectedResults, extraData) {
  );
}

add_setup(async function () {
  registerCleanupFunction(async function () {
    Services.prefs.clearUserPref(
      "privacy.trackingprotection.allow_list.hasUserInteractedWithETPSettings"
    );
  });
});

// The following are convenience objects that allow you to quickly see what is
//   and is not modified from a logical set of values.
// Be sure to always use `let expectedResults = structuredClone(allNotSpoofed)` to do a
Loading