function teardown(ed, win) {
ed.destroy();
win.close();
while (gBrowser.tabs.length > 1) {
gBrowser.removeCurrentTab();
}
finish();
}
/** * Some tests may need to import one or more of the test helper scripts. * A test helper script is simply a js file that contains common test code that * is either not common-enough to be in head.js, or that is located in a * separate directory. * The script will be loaded synchronously and in the test's scope. * @param {String} filePath The file path, relative to the current directory. * Examples: * - "helper_attributes_test_runner.js"
*/ function loadHelperScript(filePath) { const testDir = gTestPath.substr(0, gTestPath.lastIndexOf("/"));
Services.scriptloader.loadSubScript(testDir + "/" + filePath, this);
}
/** * This method returns the portion of the input string `source` up to the * [line, ch] location.
*/ function limit(source, [line, char]) {
line++; const list = source.split("\n"); if (list.length < line) { return source;
} if (line == 1) { return list[0].slice(0, char);
} return [...list.slice(0, line - 1), list[line - 1].slice(0, char)].join("\n");
}
function read(url) { const scriptableStream = Cc[ "@mozilla.org/scriptableinputstream;1"
].getService(Ci.nsIScriptableInputStream);
let data = ""; while (input.available()) {
data = data.concat(scriptableStream.read(input.available()));
}
scriptableStream.close();
input.close();
return data;
}
/** * This function is called by the CodeMirror test runner to report status * messages from the CM tests. * @see codemirror.html
*/ function codemirrorSetStatus(statusMsg, type, customMsg) { switch (type) { case"expected": case"ok":
ok(1, statusMsg); break; case"error": case"fail":
ok(0, statusMsg); break; default:
info(statusMsg); break;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.