summaryrefslogtreecommitdiffstats
path: root/devtools/server/tests/browser/browser_perf-profiler-02.js
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /devtools/server/tests/browser/browser_perf-profiler-02.js
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'devtools/server/tests/browser/browser_perf-profiler-02.js')
-rw-r--r--devtools/server/tests/browser/browser_perf-profiler-02.js46
1 files changed, 46 insertions, 0 deletions
diff --git a/devtools/server/tests/browser/browser_perf-profiler-02.js b/devtools/server/tests/browser/browser_perf-profiler-02.js
new file mode 100644
index 000000000..29842cef7
--- /dev/null
+++ b/devtools/server/tests/browser/browser_perf-profiler-02.js
@@ -0,0 +1,46 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+/**
+ * Tests if the built-in profiler module doesn't deactivate when the toolbox
+ * is destroyed if there are other consumers using it.
+ */
+
+const { PerformanceFront } = require("devtools/shared/fronts/performance");
+const { pmmIsProfilerActive, pmmStopProfiler, pmmLoadFrameScripts } = require("devtools/client/performance/test/helpers/profiler-mm-utils");
+
+add_task(function* () {
+ yield addTab(MAIN_DOMAIN + "doc_perf.html");
+ initDebuggerServer();
+ let client = new DebuggerClient(DebuggerServer.connectPipe());
+ let form = yield connectDebuggerClient(client);
+ let firstFront = PerformanceFront(client, form);
+ yield firstFront.connect();
+
+ pmmLoadFrameScripts(gBrowser);
+
+ yield firstFront.startRecording();
+
+ yield addTab(MAIN_DOMAIN + "doc_perf.html");
+ let client2 = new DebuggerClient(DebuggerServer.connectPipe());
+ let form2 = yield connectDebuggerClient(client2);
+ let secondFront = PerformanceFront(client2, form2);
+ yield secondFront.connect();
+ pmmLoadFrameScripts(gBrowser);
+
+ yield secondFront.startRecording();
+
+ // Manually teardown the tabs so we can check profiler status
+ yield secondFront.destroy();
+ yield client2.close();
+ ok((yield pmmIsProfilerActive()),
+ "The built-in profiler module should still be active.");
+
+ yield firstFront.destroy();
+ yield client.close();
+ ok(!(yield pmmIsProfilerActive()),
+ "The built-in profiler module should no longer be active.");
+
+ gBrowser.removeCurrentTab();
+ gBrowser.removeCurrentTab();
+});