diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /devtools/shared/tests/unit/test_stack.js | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-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/shared/tests/unit/test_stack.js')
-rw-r--r-- | devtools/shared/tests/unit/test_stack.js | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/devtools/shared/tests/unit/test_stack.js b/devtools/shared/tests/unit/test_stack.js new file mode 100644 index 000000000..ef747c83f --- /dev/null +++ b/devtools/shared/tests/unit/test_stack.js @@ -0,0 +1,45 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +// Test stack.js. + +function run_test() { + let loader = new DevToolsLoader(); + let require = loader.require; + + const {StackFrameCache} = require("devtools/server/actors/utils/stack"); + + let cache = new StackFrameCache(); + cache.initFrames(); + let baseFrame = { + line: 23, + column: 77, + source: "nowhere", + functionDisplayName: "nobody", + parent: null, + asyncParent: null, + asyncCause: null + }; + cache.addFrame(baseFrame); + + let event = cache.makeEvent(); + do_check_eq(event[0], null); + do_check_eq(event[1].functionDisplayName, "nobody"); + do_check_eq(event.length, 2); + + cache.addFrame({ + line: 24, + column: 78, + source: "nowhere", + functionDisplayName: "still nobody", + parent: null, + asyncParent: baseFrame, + asyncCause: "async" + }); + + event = cache.makeEvent(); + do_check_eq(event[0].functionDisplayName, "still nobody"); + do_check_eq(event[0].parent, 0); + do_check_eq(event[0].asyncParent, 1); + do_check_eq(event.length, 1); +} |