The goog.testing.editor.dom Namespace

.assertRangeBetweenText(before, after, range, opt_stopAt)

Assert that the range is surrounded by the given strings. This is useful because different browsers can place the range endpoints inside different nodes even when visually the range looks the same. Also, there may be empty text nodes in the way (again depending on the browser) making it difficult to use assertRangeEquals.

before {string}
String that should occur immediately before the start point of the range. If this is the empty string, assert will only succeed if there is no text before the start point of the range.
after {string}
String that should occur immediately after the end point of the range. If this is the empty string, assert will only succeed if there is no text after the end point of the range.
range {goog.dom.AbstractRange}
The range to be tested.
opt_stopAt {Node=}
Node to stop searching at (search will be restricted to this node's subtree).

.getNextNonEmptyTextNode(node, opt_stopAt, opt_skipDescendants)

Returns the next (in document order) node from the given node that is a non-empty text node, or null if none is found or opt_stopAt is not an ancestor of node. Note that if the given node has children, the search will start from the start tag of the node, meaning all its descendants will be included in the search, unless opt_skipDescendants is true.

node {Node}
Node to start searching from.
opt_stopAt {Node=}
Node to stop searching at (search will be restricted to this node's subtree), defaults to the body of the document containing node.
opt_skipDescendants {boolean=}
Whether to skip searching the given node's descentants.
returns {Text}
The next (in document order) node from the given node that is a non-empty text node, or null if none is found or opt_stopAt is not an ancestor of node.

.getPreviousNonEmptyTextNode(node, opt_stopAt, opt_skipDescendants)

Returns the previous (in document order) node from the given node that is a non-empty text node, or null if none is found or opt_stopAt is not an ancestor of node. Note that if the given node has children, the search will start from the end tag of the node, meaning all its descendants will be included in the search, unless opt_skipDescendants is true.

node {Node}
Node to start searching from.
opt_stopAt {Node=}
Node to stop searching at (search will be restricted to this node's subtree), defaults to the body of the document containing node.
opt_skipDescendants {boolean=}
Whether to skip searching the given node's descentants.
returns {Text}
The previous (in document order) node from the given node that is a non-empty text node, or null if none is found.