style.js
No description.

File Location

/goog/testing/ui/style.js


Public Protected Private

Global Functions

goog.testing.ui.style.assertStructureMatchesReference(elementreferenceId)
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.
Arguments:
element : Node
The root node of the DOM structure to test.
referenceId : string
The id of the container for the reference structure to test against.
code »
goog.testing.ui.style.assertStructureMatchesReferenceInner_(elementreference)
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 goog.testing.ui.style.assertStructureMatchesReference.
Arguments:
element : Node
DOM element to test.
reference : Node
DOM element to use as a reference (test against).
code »
goog.testing.ui.style.getElementChildren(element) !Array.<!Node>
Returns an array of all element children of a given node.
Arguments:
element : Node
The node to get element children of.
Returns: !Array.<!Node>  An array of all the element children.
code »
goog.testing.ui.style.getReferenceNode(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.
Arguments:
referenceId : string
The id of a container element for a reference structure in the reference page.
Returns: Node  The root element of the reference structure.
code »
goog.testing.ui.style.isContentNode(element) boolean
Tests whether a given node is a "content" node of a reference structure, which means it is allowed to have arbitrary children.
Arguments:
element : Node
The node to test.
Returns: boolean  Whether the given node is a content node or not.
code »
goog.testing.ui.style.writeReferenceFrame(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.
Arguments:
referencePath : string
A path to a reference HTML file.
code »

Directory ui

File Reference