2014-12-13 03:31:27 +00:00
|
|
|
/* Any copyright is dedicated to the Public Domain.
|
|
|
|
http://creativecommons.org/publicdomain/zero/1.0/ */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Tests that the graphs' selections are linked.
|
|
|
|
*/
|
2015-05-25 12:42:51 +00:00
|
|
|
function* spawnTest() {
|
2014-12-13 03:31:27 +00:00
|
|
|
let { panel } = yield initPerformance(SIMPLE_URL);
|
|
|
|
let { EVENTS, OverviewView } = panel.panelWin;
|
|
|
|
|
2015-02-06 18:20:19 +00:00
|
|
|
// Enable memory to test all the overview graphs.
|
|
|
|
Services.prefs.setBoolPref(MEMORY_PREF, true);
|
2014-12-13 03:31:27 +00:00
|
|
|
|
|
|
|
yield startRecording(panel);
|
2015-02-06 18:20:19 +00:00
|
|
|
|
|
|
|
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),
|
|
|
|
]);
|
|
|
|
|
2014-12-13 03:31:27 +00:00
|
|
|
yield stopRecording(panel);
|
|
|
|
|
2015-04-25 04:04:02 +00:00
|
|
|
let framerateGraph = OverviewView.graphs.get("framerate");
|
|
|
|
let markersOverview = OverviewView.graphs.get("timeline");
|
|
|
|
let memoryOverview = OverviewView.graphs.get("memory");
|
2015-02-06 18:20:19 +00:00
|
|
|
let MAX = framerateGraph.width;
|
|
|
|
|
2014-12-13 03:31:27 +00:00
|
|
|
// 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();
|
|
|
|
}
|