Bug 1271119 - Add SpecialPowers.doCommand() and .setCommandNode(); r?mrbkap
This is needed to port various editor tests from chrome to plain
mochitests.
MozReview-Commit-ID: BXNe0EiqVgV
--- a/testing/specialpowers/content/specialpowersAPI.js
+++ b/testing/specialpowers/content/specialpowersAPI.js
@@ -2078,13 +2078,23 @@ SpecialPowersAPI.prototype = {
},
};
},
observeMutationEvents: function(mo, node, nativeAnonymousChildList, subtree) {
unwrapIfWrapped(mo).observe(unwrapIfWrapped(node),
{nativeAnonymousChildList, subtree});
},
+
+ doCommand(window, cmd) {
+ return this._getDocShell(window).doCommand(cmd);
+ },
+
+ setCommandNode(window, node) {
+ return this._getDocShell(window).contentViewer
+ .QueryInterface(Ci.nsIContentViewerEdit)
+ .setCommandNode(node);
+ },
};
this.SpecialPowersAPI = SpecialPowersAPI;
this.bindDOMWindowUtils = bindDOMWindowUtils;
this.getRawComponents = getRawComponents;