function doTest() { varinput = document.getElementById("ip");
// Add multiple listeners to the same editor var editor = SpecialPowers.wrap(input).editor; var listener1 = new listener();
listener1.input = input; var listener2 = new listener();
listener2.input = input; var listener3 = new listener();
listener3.input = input;
editor.addDocumentStateListener(listener1);
editor.addDocumentStateListener(listener2);
editor.addDocumentStateListener(listener3);
// Test 1. Fire NotifyDocumentStateChanged notifications where the
// listeners remove themselves input.value = "mozilla";
editor.undo();
// Report success if we get here - clearly we didn't crash
ok(true, "Multiple listeners removed themselves after " + "NotifyDocumentStateChanged notifications - didn't crash");
// Add the listeners again for the next test
editor.addDocumentStateListener(listener1);
editor.addDocumentStateListener(listener2);
editor.addDocumentStateListener(listener3);
// Test 2. Fire NotifyDocumentWillBeDestroyed notifications where the
// listeners remove themselves (though in the real world, listeners
// shouldn't do this as nsEditor::PreDestroy removes them as
// listeners anyway)
document.body.removeChild(input);
ok(true, "Multiple listeners removed themselves after " + "NotifyDocumentWillBeDestroyed notifications - didn't crash");
SimpleTest.finish();
}
</script>
</pre>
<input type="text" id="ip" />
</body>
</html>
Messung V0.5
¤ 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.0.27Bemerkung:
(vorverarbeitet)
¤
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 und die Messung sind noch experimentell.