Bug 1111045 - Selection should always be disabled while recording in the new performance tool, r=jsantell

--HG--
rename : browser/devtools/performance/test/browser_perf-overview-selection.js => browser/devtools/performance/test/browser_perf-overview-selection-01.js
This commit is contained in:
Victor Porof 2014-12-12 19:45:33 -05:00
Родитель 26f7493ecf
Коммит bd72620c3a
4 изменённых файлов: 41 добавлений и 3 удалений

Просмотреть файл

@ -32,7 +32,8 @@ support-files =
[browser_perf-ui-recording.js]
[browser_perf-overview-render-01.js]
[browser_perf-overview-render-02.js]
[browser_perf-overview-selection.js]
[browser_perf-overview-selection-01.js]
[browser_perf-overview-selection-02.js]
[browser_perf-details.js]
[browser_perf-jump-to-debugger-01.js]

Просмотреть файл

@ -0,0 +1,34 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
/**
* Tests that the graphs' selection is correctly disabled or enabled.
*/
function spawnTest () {
let { panel } = yield initPerformance(SIMPLE_URL);
let { EVENTS, OverviewView } = panel.panelWin;
let graph = OverviewView.framerateGraph;
yield startRecording(panel);
ok(!graph.selectionEnabled,
"Selection shouldn't be enabled when the first recording started.");
yield stopRecording(panel);
ok(graph.selectionEnabled,
"Selection should be enabled when the first recording finishes.");
yield startRecording(panel);
ok(!graph.selectionEnabled,
"Selection shouldn't be enabled when the second recording started.");
yield stopRecording(panel);
ok(graph.selectionEnabled,
"Selection should be enabled when the first second finishes.");
yield teardown(panel);
finish();
}

Просмотреть файл

@ -97,7 +97,10 @@ let OverviewView = {
* Fires an event to be handled elsewhere.
*/
_onGraphMouseUp: function () {
this._onSelectionChange();
// Only fire a selection change event if the selection is actually enabled.
if (this.framerateGraph.selectionEnabled) {
this._onSelectionChange();
}
},
/**
@ -116,7 +119,6 @@ let OverviewView = {
_initializeFramerateGraph: Task.async(function *() {
let graph = new LineGraphWidget(this._framerateEl, L10N.getStr("graphs.fps"));
graph.fixedHeight = FRAMERATE_GRAPH_HEIGHT;
graph.selectionEnabled = false;
this.framerateGraph = graph;
yield graph.ready();
@ -140,6 +142,7 @@ let OverviewView = {
_start: function () {
this._timeoutId = setTimeout(this._onRecordingTick, OVERVIEW_UPDATE_INTERVAL);
this.framerateGraph.dropSelection();
this.framerateGraph.selectionEnabled = false;
},
_stop: function () {