michael@0: /* Any copyright is dedicated to the Public Domain. michael@0: http://creativecommons.org/publicdomain/zero/1.0/ */ michael@0: michael@0: /** michael@0: * Tests whether the frontend displays the correct info for a snapshot michael@0: * after finishing recording. michael@0: */ michael@0: michael@0: function ifTestingSupported() { michael@0: let [target, debuggee, panel] = yield initCanavsDebuggerFrontend(SIMPLE_CANVAS_URL); michael@0: let { window, EVENTS, $, SnapshotsListView } = panel.panelWin; michael@0: michael@0: yield reload(target); michael@0: michael@0: let recordingFinished = once(window, EVENTS.SNAPSHOT_RECORDING_FINISHED); michael@0: SnapshotsListView._onRecordButtonClick(); michael@0: michael@0: yield recordingFinished; michael@0: ok(true, "Finished recording a snapshot of the animation loop."); michael@0: michael@0: let item = SnapshotsListView.getItemAtIndex(0); michael@0: michael@0: is(SnapshotsListView.selectedItem, item, michael@0: "The first item should now be selected in the snapshots list view (1)."); michael@0: is(SnapshotsListView.selectedIndex, 0, michael@0: "The first item should now be selected in the snapshots list view (2)."); michael@0: michael@0: is($(".snapshot-item-calls", item.target).getAttribute("value"), "4 draws, 8 calls", michael@0: "The placeholder item's calls label is correct."); michael@0: is($(".snapshot-item-save", item.target).getAttribute("value"), "Save", michael@0: "The placeholder item's save label is correct."); michael@0: is($(".snapshot-item-save", item.target).getAttribute("disabled"), "false", michael@0: "The placeholder item's save label should be clickable."); michael@0: michael@0: yield teardown(panel); michael@0: finish(); michael@0: }