tenfourfox/devtools/client/performance/test/browser_perf-clear-01.js
Cameron Kaiser c9b2922b70 hello FPR
2017-04-19 00:56:45 -07:00

31 lines
922 B
JavaScript

/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
/**
* Tests that clearing recordings empties out the recordings list and toggles
* the empty notice state.
*/
var test = Task.async(function*() {
let { target, panel, toolbox } = yield initPerformance(SIMPLE_URL);
let { EVENTS, PerformanceController, PerformanceView, RecordingsView, OverviewView } = panel.panelWin;
yield startRecording(panel);
yield stopRecording(panel);
yield startRecording(panel);
yield stopRecording(panel);
yield PerformanceController.clearRecordings();
is(RecordingsView.itemCount, 0,
"RecordingsView should be empty.");
is(PerformanceView.getState(), "empty",
"PerformanceView should be in an empty state.");
is(PerformanceController.getCurrentRecording(), null,
"There should be no current recording.");
yield teardown(panel);
finish();
});