2014-09-10 17:11:06 +00:00
|
|
|
/* Any copyright is dedicated to the Public Domain.
|
|
|
|
http://creativecommons.org/publicdomain/zero/1.0/ */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Tests if the timeline panels are correctly shown and hidden when
|
|
|
|
* recording starts and stops.
|
|
|
|
*/
|
|
|
|
|
|
|
|
let test = Task.async(function*() {
|
2014-09-21 23:07:47 +00:00
|
|
|
let { target, panel } = yield initTimelinePanel(SIMPLE_URL);
|
2014-09-10 17:11:06 +00:00
|
|
|
let { $, EVENTS } = panel.panelWin;
|
|
|
|
|
|
|
|
is($("#record-button").hasAttribute("checked"), false,
|
|
|
|
"The record button should not be checked yet.");
|
|
|
|
is($("#timeline-pane").selectedPanel, $("#empty-notice"),
|
|
|
|
"An empty notice is initially displayed instead of the waterfall view.");
|
|
|
|
|
|
|
|
let whenRecStarted = panel.panelWin.once(EVENTS.RECORDING_STARTED);
|
|
|
|
EventUtils.synthesizeMouseAtCenter($("#record-button"), {}, panel.panelWin);
|
|
|
|
yield whenRecStarted;
|
|
|
|
|
|
|
|
ok(true, "Recording has started.");
|
|
|
|
|
|
|
|
is($("#record-button").getAttribute("checked"), "true",
|
|
|
|
"The record button should be checked now.");
|
|
|
|
is($("#timeline-pane").selectedPanel, $("#recording-notice"),
|
|
|
|
"A recording notice is now displayed instead of the waterfall view.");
|
|
|
|
|
|
|
|
let whenRecEnded = panel.panelWin.once(EVENTS.RECORDING_ENDED);
|
|
|
|
EventUtils.synthesizeMouseAtCenter($("#record-button"), {}, panel.panelWin);
|
|
|
|
yield whenRecEnded;
|
|
|
|
|
|
|
|
ok(true, "Recording has ended.");
|
|
|
|
|
|
|
|
is($("#record-button").hasAttribute("checked"), false,
|
|
|
|
"The record button should be unchecked again.");
|
2014-11-24 04:55:25 +00:00
|
|
|
is($("#timeline-pane").selectedPanel, $("#timeline-waterfall-container"),
|
2014-09-10 17:11:06 +00:00
|
|
|
"A waterfall view is now displayed.");
|
|
|
|
|
|
|
|
yield teardown(panel);
|
|
|
|
finish();
|
|
|
|
});
|