Bug 1496699 - Refactor gcparam.js test r=sfink
authorPaul Bone <pbone@mozilla.com>
Thu, 11 Oct 2018 10:44:11 +1100
changeset 488926 6dd61044e50ab89772a49adc1c8f020d1d32d1ec
parent 488925 2398cc611aba734f6de7000d3429f40efb0517eb
child 488927 0e32136949201c16777740ec69999caa8541657b
push id246
push userfmarier@mozilla.com
push dateSat, 13 Oct 2018 00:15:40 +0000
reviewerssfink
bugs1496699
milestone64.0a1
Bug 1496699 - Refactor gcparam.js test r=sfink
js/src/jit-test/tests/gc/gcparam.js
--- a/js/src/jit-test/tests/gc/gcparam.js
+++ b/js/src/jit-test/tests/gc/gcparam.js
@@ -2,26 +2,35 @@ gczeal(0);
 
 function testGetParam(key) {
     gcparam(key);
 }
 
 function testChangeParam(key) {
     let prev = gcparam(key);
     let value = prev - 1;
-    gcparam(key, value);
-    assertEq(gcparam(key), value);
-    gcparam(key, prev);
+    try {
+        gcparam(key, value);
+        assertEq(gcparam(key), value);
+        gcparam(key, prev);
+        assertEq(gcparam(key), prev);
+    } catch {
+        assertEq(gcparam(key), prev);
+    }
 }
 
-function testLargeParamValue(key) {
+function testMBParamValue(key) {
     let prev = gcparam(key);
     const value = 1024;
-    gcparam(key, value);
-    assertEq(gcparam(key), value);
+    try {
+        gcparam(key, value);
+        assertEq(gcparam(key), value);
+    } catch {
+        assertEq(gcparam(key), prev);
+    }
     gcparam(key, prev);
 }
 
 testGetParam("gcBytes");
 testGetParam("gcNumber");
 testGetParam("unusedChunks");
 testGetParam("totalChunks");
 
@@ -38,10 +47,10 @@ testChangeParam("highFrequencyHeapGrowth
 testChangeParam("lowFrequencyHeapGrowth");
 testChangeParam("dynamicHeapGrowth");
 testChangeParam("dynamicMarkSlice");
 testChangeParam("allocationThreshold");
 testChangeParam("minEmptyChunkCount");
 testChangeParam("maxEmptyChunkCount");
 testChangeParam("compactingEnabled");
 
-testLargeParamValue("highFrequencyLowLimit");
-testLargeParamValue("highFrequencyHighLimit");
+testMBParamValue("highFrequencyLowLimit");
+testMBParamValue("highFrequencyHighLimit");