Home

# Library goog.testing.ui.style

Function Summary
| `assertStructureMatchesReference(?Node element, string referenceId)` Tests that the structure, node names, and classes of the given element are the same as the reference structure with the given id. Throws an error if the element doesn't have the same nodes at each level of the DOM with the same classes on each. The test ignores all DOM structure within content nodes.
| `assertStructureMatchesReferenceInner_(?Node element, ?Node reference)` A recursive function for comparing structure, node names, and classes between a test and reference DOM structure. Throws an error if one of these things doesn't match. Used internally by {@link goog.testing.ui.style.assertStructureMatchesReference}.
| `getElementChildren(?Node element) ⇒ ?Array` Returns an array of all element children of a given node.
| `getReferenceNode(string referenceId) ⇒ ?Node` Returns a reference to the first element child of a node with the given id from the page loaded into the reference iFrame. Used to retrieve a particular reference DOM structure to test against.
| `isContentNode(?Node element) ⇒ boolean` Tests whether a given node is a "content" node of a reference structure, which means it is allowed to have arbitrary children.
| `writeReferenceFrame(string referencePath)` Uses document.write to add an iFrame to the page with the reference path in the src attribute. Used for loading an html file containing reference structures to test against into the page. Should be called within the body of the jsunit test page.