1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/tools/profiler/tests/test_enterjit_osr_enabling.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,21 @@ 1.4 +function run_test() { 1.5 + let p = Cc["@mozilla.org/tools/profiler;1"]; 1.6 + // Just skip the test if the profiler component isn't present. 1.7 + if (!p) 1.8 + return; 1.9 + p = p.getService(Ci.nsIProfiler); 1.10 + if (!p) 1.11 + return; 1.12 + 1.13 + do_check_true(!p.IsActive()); 1.14 + 1.15 + // The function is entered with the profiler disabled. 1.16 + (function (){ 1.17 + p.StartProfiler(100, 10, ["js"], 1); 1.18 + let n = 10000; 1.19 + while (--n); // OSR happens here with the profiler enabled. 1.20 + // An assertion will fail when this function returns, if the 1.21 + // SPS stack was misbalanced. 1.22 + })(); 1.23 + p.StopProfiler(); 1.24 +}