Changes between Version 22 and Version 23 of Writing Layout Tests for DumpRenderTree

Jun 25, 2011 8:15:42 AM (12 years ago)

Documents window.internals.


  • Writing Layout Tests for DumpRenderTree

    v22 v23  
    126126To test a bug having to do with the loader or the back/forward cache, call this method to run a script after executing a back/forward navigation. The first argument is the script to run, and the second argument is the page to load during the navigation. The second argument is optional. It defaults to `about:blank`.
     128== `window.internals` ==
     130=== `createShadowContentElement(Document)` ===
     132Creates a `<content>` element for use in shadow DOM. These elements can not be created from JavaScript, hence this constructor in the test harness.
     134=== `elementRenderTreeAsText(Element)` ===
     136Gets and returns the element’s renderer’s description of its tree as a String.
     138=== `ensureShadowRoot(Element)` ===
     140Given a host element, returns its shadow root node. If the element doesn’t have a shadow root one is created and attached to the element. If you want to just retrieve a shadow root without creating one, use ''shadowRoot''. ''ensureShadowRoot'' only inspects DOM shadows; not SVG shadows.
     142=== `isPreloaded(Document, String url)` ===
     144Gets whether the specified document’s cached resource loader has the specified URL preloaded.
     146=== `removeShadowRoot(Element)` ===
     148Given a host element, removes its shadow root if it has one. ''removeShadowRoot'' only inspects DOM shadows; not SVG shadows.
     150=== `shadowPseudoId(Element)` ===
     152Gets the specified element’s CSS pseudo-id for styling when in shadow DOM.
     154=== `shadowRoot(Element)` ===
     156Given a host element gets its shadow root, if it has one; otherwise ''shadowRoot'' returns `null`.
    128158= Writing tests which require network access =