diff options
author | Matt A. Tobin <email@mattatobin.com> | 2016-10-16 19:34:53 -0400 |
---|---|---|
committer | Matt A. Tobin <email@mattatobin.com> | 2016-10-16 19:34:53 -0400 |
commit | 81805ce3f63e2e4a799bd54f174083c58a9b5640 (patch) | |
tree | 6e13374b213ac9b2ae74c25d8aac875faf71fdd0 /toolkit/devtools/performance/test/browser_perf-overview-selection-03.js | |
parent | 28c8da71bf521bb3ee76f27b8a241919e24b7cd5 (diff) | |
download | palemoon-gre-81805ce3f63e2e4a799bd54f174083c58a9b5640.tar.gz |
Move Mozilla DevTools to Platform - Part 3: Merge the browser/devtools and toolkit/devtools adjusting for directory collisions
Diffstat (limited to 'toolkit/devtools/performance/test/browser_perf-overview-selection-03.js')
-rw-r--r-- | toolkit/devtools/performance/test/browser_perf-overview-selection-03.js | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/toolkit/devtools/performance/test/browser_perf-overview-selection-03.js b/toolkit/devtools/performance/test/browser_perf-overview-selection-03.js new file mode 100644 index 000000000..7503f4b55 --- /dev/null +++ b/toolkit/devtools/performance/test/browser_perf-overview-selection-03.js @@ -0,0 +1,76 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +/** + * Tests that the graphs' selections are linked. + */ +function spawnTest () { + let { panel } = yield initPerformance(SIMPLE_URL); + let { EVENTS, OverviewView } = panel.panelWin; + + // Enable memory to test all the overview graphs. + Services.prefs.setBoolPref(MEMORY_PREF, true); + + yield startRecording(panel); + + yield Promise.all([ + once(OverviewView, EVENTS.FRAMERATE_GRAPH_RENDERED), + once(OverviewView, EVENTS.MARKERS_GRAPH_RENDERED), + once(OverviewView, EVENTS.MEMORY_GRAPH_RENDERED), + once(OverviewView, EVENTS.OVERVIEW_RENDERED), + ]); + + yield stopRecording(panel); + + let framerateGraph = OverviewView.framerateGraph; + let markersOverview = OverviewView.markersOverview; + let memoryOverview = OverviewView.memoryOverview; + let MAX = framerateGraph.width; + + // Perform a selection inside the framerate graph. + + let selected = once(OverviewView, EVENTS.OVERVIEW_RANGE_SELECTED); + dragStart(framerateGraph, 0); + dragStop(framerateGraph, MAX / 2); + yield selected; + + is(framerateGraph.getSelection().toSource(), "({start:0, end:" + (MAX / 2) + "})", + "The framerate graph has a correct selection."); + is(markersOverview.getSelection().toSource(), framerateGraph.getSelection().toSource(), + "The markers overview has a correct selection."); + is(memoryOverview.getSelection().toSource(), framerateGraph.getSelection().toSource(), + "The memory overview has a correct selection."); + + // Perform a selection inside the markers overview. + + selected = once(OverviewView, EVENTS.OVERVIEW_RANGE_SELECTED); + markersOverview.dropSelection(); + dragStart(markersOverview, 0); + dragStop(markersOverview, MAX / 4); + yield selected; + + is(framerateGraph.getSelection().toSource(), "({start:0, end:" + (MAX / 4) + "})", + "The framerate graph has a correct selection."); + is(markersOverview.getSelection().toSource(), framerateGraph.getSelection().toSource(), + "The markers overview has a correct selection."); + is(memoryOverview.getSelection().toSource(), framerateGraph.getSelection().toSource(), + "The memory overview has a correct selection."); + + // Perform a selection inside the memory overview. + + selected = once(OverviewView, EVENTS.OVERVIEW_RANGE_SELECTED); + memoryOverview.dropSelection(); + dragStart(memoryOverview, 0); + dragStop(memoryOverview, MAX / 10); + yield selected; + + is(framerateGraph.getSelection().toSource(), "({start:0, end:" + (MAX / 10) + "})", + "The framerate graph has a correct selection."); + is(markersOverview.getSelection().toSource(), framerateGraph.getSelection().toSource(), + "The markers overview has a correct selection."); + is(memoryOverview.getSelection().toSource(), framerateGraph.getSelection().toSource(), + "The memory overview has a correct selection."); + + yield teardown(panel); + finish(); +} |