forked from mirrors/gecko-dev
# ignore-this-changeset Differential Revision: https://phabricator.services.mozilla.com/D35940 --HG-- extra : source : d214f0c82813e5a8d3987debc490a2c11f1308ff
18 lines
552 B
JavaScript
18 lines
552 B
JavaScript
function run_test() {
|
|
// Just skip the test if the profiler component isn't present.
|
|
if (!AppConstants.MOZ_GECKO_PROFILER) {
|
|
return;
|
|
}
|
|
|
|
Assert.ok(!Services.profiler.IsActive());
|
|
|
|
Services.profiler.StartProfiler(100, 10, ["js"]);
|
|
// The function is entered with the profiler enabled
|
|
(function() {
|
|
Services.profiler.StopProfiler();
|
|
let n = 10000;
|
|
while (--n) {} // OSR happens here with the profiler disabled.
|
|
// An assertion will fail when this function returns, if the
|
|
// profiler stack was misbalanced.
|
|
})();
|
|
}
|