test_action_diffing_01.js (764B)
1 /* Any copyright is dedicated to the Public Domain. 2 http://creativecommons.org/publicdomain/zero/1.0/ */ 3 4 "use strict"; 5 6 // Test toggling of diffing. 7 8 const { 9 toggleDiffing, 10 } = require("resource://devtools/client/memory/actions/diffing.js"); 11 12 add_task(async function () { 13 const front = new StubbedMemoryFront(); 14 const heapWorker = new HeapAnalysesClient(); 15 await front.attach(); 16 const store = Store(); 17 const { getState, dispatch } = store; 18 19 equal(getState().diffing, null, "not diffing by default"); 20 21 dispatch(toggleDiffing()); 22 ok(getState().diffing, "now diffing after toggling"); 23 24 dispatch(toggleDiffing()); 25 equal(getState().diffing, null, "not diffing again after toggling again"); 26 27 heapWorker.destroy(); 28 await front.detach(); 29 });