2017-01-27 23:35:26 +03:00
|
|
|
let testDir = gTestPath.substr(0, gTestPath.lastIndexOf("/"));
|
2019-01-23 00:26:02 +03:00
|
|
|
/* import-globals-from helper_largeAllocation.js */
|
2017-01-27 23:35:26 +03:00
|
|
|
Services.scriptloader.loadSubScript(
|
|
|
|
testDir + "/helper_largeAllocation.js",
|
|
|
|
this
|
|
|
|
);
|
|
|
|
|
|
|
|
// Force-enabling the Large-Allocation header
|
2017-06-22 13:51:42 +03:00
|
|
|
add_task(async function() {
|
2017-01-27 23:35:26 +03:00
|
|
|
info("Test 1 - force enabling the Large-Allocation header");
|
2017-06-22 13:51:42 +03:00
|
|
|
await SpecialPowers.pushPrefEnv({
|
2017-01-27 23:35:26 +03:00
|
|
|
set: [
|
|
|
|
// Enable the header if it is disabled
|
|
|
|
["dom.largeAllocationHeader.enabled", true],
|
|
|
|
// Force-enable process creation with large-allocation, such that non
|
|
|
|
// win32 builds can test the behavior.
|
|
|
|
["dom.largeAllocation.forceEnable", true],
|
|
|
|
// Increase processCount.webLargeAllocation to avoid any races where
|
|
|
|
// processes aren't being cleaned up quickly enough.
|
2019-01-23 00:26:30 +03:00
|
|
|
["dom.ipc.processCount.webLargeAllocation", 20],
|
|
|
|
],
|
2017-01-27 23:35:26 +03:00
|
|
|
});
|
|
|
|
|
2017-06-22 13:51:42 +03:00
|
|
|
await largeAllocSuccessTests();
|
2017-01-27 23:35:26 +03:00
|
|
|
});
|
|
|
|
|
2017-06-22 13:51:42 +03:00
|
|
|
add_task(async function() {
|
2017-01-27 23:35:26 +03:00
|
|
|
info("Test 2 - not force enabling the Large-Allocation header");
|
2017-06-22 13:51:42 +03:00
|
|
|
await SpecialPowers.pushPrefEnv({
|
2017-01-27 23:35:26 +03:00
|
|
|
set: [
|
|
|
|
// Enable the header if it is disabled
|
|
|
|
["dom.largeAllocationHeader.enabled", true],
|
|
|
|
// Force-enable process creation with large-allocation, such that non
|
|
|
|
// win32 builds can test the behavior.
|
|
|
|
["dom.largeAllocation.forceEnable", false],
|
|
|
|
// Increase processCount.webLargeAllocation to avoid any races where
|
|
|
|
// processes aren't being cleaned up quickly enough.
|
2019-01-23 00:26:30 +03:00
|
|
|
["dom.ipc.processCount.webLargeAllocation", 20],
|
|
|
|
],
|
2017-01-27 23:35:26 +03:00
|
|
|
});
|
|
|
|
|
2017-06-22 13:51:42 +03:00
|
|
|
await largeAllocFailTests();
|
2017-01-27 23:35:26 +03:00
|
|
|
});
|