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 a placeholder snapshot while 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, L10N, $, SnapshotsListView } = panel.panelWin; michael@0: michael@0: yield reload(target); michael@0: michael@0: let recordingStarted = once(window, EVENTS.SNAPSHOT_RECORDING_STARTED); michael@0: let recordingFinished = once(window, EVENTS.SNAPSHOT_RECORDING_FINISHED); michael@0: let recordingSelected = once(window, EVENTS.SNAPSHOT_RECORDING_SELECTED); michael@0: SnapshotsListView._onRecordButtonClick(); michael@0: michael@0: yield recordingStarted; michael@0: ok(true, "Started recording a snapshot of the animation loop."); michael@0: michael@0: let item = SnapshotsListView.getItemAtIndex(0); michael@0: michael@0: is($(".snapshot-item-title", item.target).getAttribute("value"), michael@0: L10N.getFormatStr("snapshotsList.itemLabel", 1), michael@0: "The placeholder item's title label is correct."); michael@0: michael@0: is($(".snapshot-item-calls", item.target).getAttribute("value"), michael@0: L10N.getStr("snapshotsList.loadingLabel"), michael@0: "The placeholder item's calls label is correct."); michael@0: michael@0: is($(".snapshot-item-save", item.target).getAttribute("value"), "", michael@0: "The placeholder item's save label should not have a value yet."); michael@0: michael@0: is($("#reload-notice").getAttribute("hidden"), "true", michael@0: "The reload notice should now be hidden."); michael@0: is($("#empty-notice").getAttribute("hidden"), "true", michael@0: "The empty notice should now be hidden."); michael@0: is($("#import-notice").hasAttribute("hidden"), false, michael@0: "The import notice should now be visible."); michael@0: michael@0: is($("#screenshot-container").getAttribute("hidden"), "true", michael@0: "The screenshot container should still be hidden."); michael@0: is($("#snapshot-filmstrip").getAttribute("hidden"), "true", michael@0: "The snapshot filmstrip should still be hidden."); michael@0: michael@0: is($("#debugging-pane-contents").getAttribute("hidden"), "true", michael@0: "The rest of the UI should still be hidden."); michael@0: michael@0: yield recordingFinished; michael@0: ok(true, "Finished recording a snapshot of the animation loop."); michael@0: michael@0: yield recordingSelected; michael@0: ok(true, "Finished selecting a snapshot of the animation loop."); michael@0: michael@0: is($("#reload-notice").getAttribute("hidden"), "true", michael@0: "The reload notice should now be hidden."); michael@0: is($("#empty-notice").getAttribute("hidden"), "true", michael@0: "The empty notice should now be hidden."); michael@0: is($("#import-notice").getAttribute("hidden"), "true", michael@0: "The import notice should now be hidden."); michael@0: michael@0: is($("#screenshot-container").hasAttribute("hidden"), false, michael@0: "The screenshot container should now be visible."); michael@0: is($("#snapshot-filmstrip").hasAttribute("hidden"), false, michael@0: "The snapshot filmstrip should now be visible."); michael@0: michael@0: is($("#debugging-pane-contents").hasAttribute("hidden"), false, michael@0: "The rest of the UI should now be visible."); michael@0: michael@0: yield teardown(panel); michael@0: finish(); michael@0: }