mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-11-12 14:20:14 +02:00
Depends on D10564 Differential Revision: https://phabricator.services.mozilla.com/D11293 --HG-- extra : moz-landing-system : lando
40 lines
1.2 KiB
JavaScript
40 lines
1.2 KiB
JavaScript
/* Any copyright is dedicated to the Public Domain.
|
|
http://creativecommons.org/publicdomain/zero/1.0/ */
|
|
|
|
/**
|
|
* Tests if the profiler connection front does not activate the built-in
|
|
* profiler module if not necessary, and doesn't deactivate it when
|
|
* a recording is stopped.
|
|
*/
|
|
|
|
"use strict";
|
|
|
|
const { pmmIsProfilerActive, pmmLoadFrameScripts } = require("devtools/client/performance/test/helpers/profiler-mm-utils");
|
|
|
|
add_task(async function() {
|
|
const target = await addTabTarget(MAIN_DOMAIN + "doc_perf.html");
|
|
|
|
const front = await target.getFront("performance");
|
|
|
|
pmmLoadFrameScripts(gBrowser);
|
|
|
|
ok(!(await pmmIsProfilerActive()),
|
|
"The built-in profiler module should not have been automatically started.");
|
|
|
|
let rec = await front.startRecording();
|
|
await front.stopRecording(rec);
|
|
ok((await pmmIsProfilerActive()),
|
|
"The built-in profiler module should still be active (1).");
|
|
|
|
rec = await front.startRecording();
|
|
await front.stopRecording(rec);
|
|
ok((await pmmIsProfilerActive()),
|
|
"The built-in profiler module should still be active (2).");
|
|
|
|
await target.destroy();
|
|
|
|
ok(!(await pmmIsProfilerActive()),
|
|
"The built-in profiler module should no longer be active.");
|
|
|
|
gBrowser.removeCurrentTab();
|
|
});
|