michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: function run_test() { michael@0: // If we can't get the profiler component then assume gecko was michael@0: // built without it and pass all the tests michael@0: var profilerCc = Cc["@mozilla.org/tools/profiler;1"]; michael@0: if (!profilerCc) michael@0: return; michael@0: michael@0: var profiler = profilerCc.getService(Ci.nsIProfiler); michael@0: if (!profiler) michael@0: return; michael@0: michael@0: do_check_true(!profiler.IsActive()); michael@0: do_check_true(!profiler.IsPaused()); michael@0: michael@0: profiler.StartProfiler(1000, 10, [], 0); michael@0: michael@0: do_check_true(profiler.IsActive()); michael@0: michael@0: profiler.PauseSampling(); michael@0: michael@0: do_check_true(profiler.IsPaused()); michael@0: michael@0: profiler.ResumeSampling(); michael@0: michael@0: do_check_true(!profiler.IsPaused()); michael@0: michael@0: profiler.StopProfiler(); michael@0: do_check_true(!profiler.IsActive()); michael@0: do_check_true(!profiler.IsPaused()); michael@0: do_test_finished(); michael@0: }