Bug 942774 - Fix files loaded into scratchpad to be recognized as "saved". r=benvie

This commit is contained in:
Peiyong Lin 2014-01-22 10:23:21 -08:00
parent f87abe03e2
commit 4603961146
2 changed files with 4 additions and 0 deletions

View File

@ -982,6 +982,7 @@ var Scratchpad = {
this.editor.setText(content);
this.editor.clearHistory();
this.dirty = false;
document.getElementById("sp-cmd-revert").setAttribute("disabled", true);
}
else if (!aSilentError) {

View File

@ -53,6 +53,9 @@ function fileImported(aStatus, aFileContent)
is(gScratchpad.getText(), gFileContent,
"the editor content is correct");
is(gScratchpad.dirty, false,
"the editor marks imported file as saved");
// Save the file after changes.
gFileContent += "// omg, saved!";
gScratchpad.editor.setText(gFileContent);