summaryrefslogtreecommitdiffstats
path: root/devtools/client/memory/test/unit/test_action_diffing_01.js
diff options
context:
space:
mode:
Diffstat (limited to 'devtools/client/memory/test/unit/test_action_diffing_01.js')
-rw-r--r--devtools/client/memory/test/unit/test_action_diffing_01.js29
1 files changed, 29 insertions, 0 deletions
diff --git a/devtools/client/memory/test/unit/test_action_diffing_01.js b/devtools/client/memory/test/unit/test_action_diffing_01.js
new file mode 100644
index 000000000..24893581e
--- /dev/null
+++ b/devtools/client/memory/test/unit/test_action_diffing_01.js
@@ -0,0 +1,29 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+// Test toggling of diffing.
+
+const { toggleDiffing } = require("devtools/client/memory/actions/diffing");
+
+function run_test() {
+ run_next_test();
+}
+
+add_task(function* () {
+ let front = new StubbedMemoryFront();
+ let heapWorker = new HeapAnalysesClient();
+ yield front.attach();
+ let store = Store();
+ const { getState, dispatch } = store;
+
+ equal(getState().diffing, null, "not diffing by default");
+
+ dispatch(toggleDiffing());
+ ok(getState().diffing, "now diffing after toggling");
+
+ dispatch(toggleDiffing());
+ equal(getState().diffing, null, "not diffing again after toggling again");
+
+ heapWorker.destroy();
+ yield front.detach();
+});