Bug 1306124 - Consistently emit the last rendered message in dom for jsterm.execute and with new-messages event;r=linclark
MozReview-Commit-ID: 5100HMmdTr2
This commit is contained in:
@@ -17,6 +17,7 @@ const FilterBar = React.createFactory(require("devtools/client/webconsole/new-co
|
||||
const store = configureStore();
|
||||
|
||||
function NewConsoleOutputWrapper(parentNode, jsterm, toolbox, owner) {
|
||||
this.parentNode = parentNode;
|
||||
this.parentNode = parentNode;
|
||||
this.jsterm = jsterm;
|
||||
this.toolbox = toolbox;
|
||||
@@ -68,6 +69,12 @@ NewConsoleOutputWrapper.prototype = {
|
||||
dispatchMessagesClear: () => {
|
||||
store.dispatch(actions.messagesClear());
|
||||
},
|
||||
getLastMessage: function() {
|
||||
// Return the last message in the DOM as the message that was just dispatched. This may not
|
||||
// always be correct in the case of filtered messages, but it's close enough for our tests.
|
||||
let messageNodes = this.parentNode.querySelectorAll(".message");
|
||||
return messageNodes[messageNodes.length - 1]
|
||||
},
|
||||
};
|
||||
|
||||
// Exports from this module
|
||||
|
||||
Reference in New Issue
Block a user