2014-09-10 10:11:06 -07:00
|
|
|
/* Any copyright is dedicated to the Public Domain.
|
|
|
|
http://creativecommons.org/publicdomain/zero/1.0/ */
|
|
|
|
|
|
|
|
/**
|
2014-11-13 06:18:19 -08:00
|
|
|
* Tests if the markers and memory overviews are continuously updated.
|
2014-09-10 10:11:06 -07:00
|
|
|
*/
|
|
|
|
|
2014-12-18 17:59:00 -08:00
|
|
|
add_task(function*() {
|
2014-09-21 16:07:47 -07:00
|
|
|
let { target, panel } = yield initTimelinePanel("about:blank");
|
2014-11-13 06:18:19 -08:00
|
|
|
let { $, EVENTS, TimelineView, TimelineController } = panel.panelWin;
|
|
|
|
|
|
|
|
$("#memory-checkbox").checked = true;
|
|
|
|
yield TimelineController.updateMemoryRecording();
|
2014-09-10 10:11:06 -07:00
|
|
|
|
|
|
|
yield TimelineController.toggleRecording();
|
|
|
|
ok(true, "Recording has started.");
|
|
|
|
|
2014-11-13 06:18:19 -08:00
|
|
|
ok("selectionEnabled" in TimelineView.markersOverview,
|
|
|
|
"The selection should not be enabled for the markers overview (1).");
|
|
|
|
is(TimelineView.markersOverview.selectionEnabled, false,
|
|
|
|
"The selection should not be enabled for the markers overview (2).");
|
|
|
|
is(TimelineView.markersOverview.hasSelection(), false,
|
|
|
|
"The markers overview shouldn't have a selection before recording.");
|
|
|
|
|
|
|
|
ok("selectionEnabled" in TimelineView.memoryOverview,
|
|
|
|
"The selection should not be enabled for the memory overview (1).");
|
|
|
|
is(TimelineView.memoryOverview.selectionEnabled, false,
|
|
|
|
"The selection should not be enabled for the memory overview (2).");
|
|
|
|
is(TimelineView.memoryOverview.hasSelection(), false,
|
|
|
|
"The memory overview shouldn't have a selection before recording.");
|
2014-09-10 10:11:06 -07:00
|
|
|
|
|
|
|
let updated = 0;
|
|
|
|
panel.panelWin.on(EVENTS.OVERVIEW_UPDATED, () => updated++);
|
|
|
|
|
|
|
|
ok((yield waitUntil(() => updated > 10)),
|
2014-11-13 06:18:19 -08:00
|
|
|
"The overviews were updated a bunch of times.");
|
|
|
|
ok((yield waitUntil(() => TimelineController.getMemory().length > 10)),
|
|
|
|
"There are some memory measurements available now.");
|
|
|
|
|
|
|
|
ok("selectionEnabled" in TimelineView.markersOverview,
|
|
|
|
"The selection should still not be enabled for the markers overview (3).");
|
|
|
|
is(TimelineView.markersOverview.selectionEnabled, false,
|
|
|
|
"The selection should still not be enabled for the markers overview (4).");
|
|
|
|
is(TimelineView.markersOverview.hasSelection(), false,
|
|
|
|
"The markers overview should not have a selection while recording.");
|
2014-09-10 10:11:06 -07:00
|
|
|
|
2014-11-13 06:18:19 -08:00
|
|
|
ok("selectionEnabled" in TimelineView.memoryOverview,
|
|
|
|
"The selection should still not be enabled for the memory overview (3).");
|
|
|
|
is(TimelineView.memoryOverview.selectionEnabled, false,
|
|
|
|
"The selection should still not be enabled for the memory overview (4).");
|
|
|
|
is(TimelineView.memoryOverview.hasSelection(), false,
|
|
|
|
"The memory overview should not have a selection while recording.");
|
2014-09-10 10:11:06 -07:00
|
|
|
|
|
|
|
yield TimelineController.toggleRecording();
|
|
|
|
ok(true, "Recording has ended.");
|
|
|
|
|
2015-01-15 04:21:10 -08:00
|
|
|
// TODO: Re-enable this assertion as part of bug 1120830
|
|
|
|
// is(TimelineController.getMarkers().length, 0,
|
|
|
|
// "There are no markers available.");
|
2014-11-13 06:18:19 -08:00
|
|
|
isnot(TimelineController.getMemory().length, 0,
|
|
|
|
"There are some memory measurements available.");
|
|
|
|
|
|
|
|
is(TimelineView.markersOverview.selectionEnabled, true,
|
|
|
|
"The selection should now be enabled for the markers overview.");
|
2015-01-15 04:21:10 -08:00
|
|
|
// TODO: Re-enable this assertion as part of bug 1120830
|
|
|
|
// is(TimelineView.markersOverview.hasSelection(), false,
|
|
|
|
// "The markers overview should not have a selection after recording.");
|
2014-11-13 06:18:19 -08:00
|
|
|
|
|
|
|
is(TimelineView.memoryOverview.selectionEnabled, true,
|
|
|
|
"The selection should now be enabled for the memory overview.");
|
2015-01-15 04:21:10 -08:00
|
|
|
// TODO: Re-enable this assertion as part of bug 1120830
|
|
|
|
// is(TimelineView.memoryOverview.hasSelection(), false,
|
|
|
|
// "The memory overview should not have a selection after recording.");
|
2014-09-10 10:11:06 -07:00
|
|
|
});
|