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/client/performance/test/browser_perf-tree-view-09.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/client/performance/test/browser_perf-tree-view-09.js')
-rw-r--r-- | devtools/client/performance/test/browser_perf-tree-view-09.js | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/devtools/client/performance/test/browser_perf-tree-view-09.js b/devtools/client/performance/test/browser_perf-tree-view-09.js new file mode 100644 index 000000000..c7f11549e --- /dev/null +++ b/devtools/client/performance/test/browser_perf-tree-view-09.js @@ -0,0 +1,59 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ +"use strict"; + +/** + * Tests that the profiler's tree view sorts inverted call trees by + * "self cost" and not "total cost". + */ + +const { ThreadNode } = require("devtools/client/performance/modules/logic/tree-model"); +const { CallView } = require("devtools/client/performance/modules/widgets/tree-view"); +const RecordingUtils = require("devtools/shared/performance/recording-utils"); + +add_task(function () { + let threadNode = new ThreadNode(gProfile.threads[0], { startTime: 0, endTime: 20, + invertTree: true }); + let treeRoot = new CallView({ frame: threadNode, inverted: true }); + let container = document.createElement("vbox"); + treeRoot.attachTo(container); + + is(treeRoot.getChild(0).frame.location, "B", + "The tree root's first child is the `B` function."); + is(treeRoot.getChild(1).frame.location, "A", + "The tree root's second child is the `A` function."); +}); + +const gProfile = RecordingUtils.deflateProfile({ + meta: { version: 2 }, + threads: [{ + samples: [{ + time: 1, + frames: [ + { location: "(root)" }, + { location: "A" }, + { location: "B" }, + ] + }, { + time: 2, + frames: [ + { location: "(root)" }, + { location: "A" }, + { location: "B" } + ] + }, { + time: 3, + frames: [ + { location: "(root)" }, + { location: "A" }, + { location: "B" }, + ] + }, { + time: 4, + frames: [ + { location: "(root)" }, + { location: "A" } + ] + }] + }] +}); |