Changes between Version 1 and Version 2 of Writing DumpAsMarkup Tests


Ignore:
Timestamp:
Aug 3, 2010 2:29:36 PM (9 years ago)
Author:
rniwa@webkit.org
Comment:

Updated "How to Use" to match the recent changes

Legend:

Unmodified
Added
Removed
Modified
  • Writing DumpAsMarkup Tests

    v1 v2  
    1515}}}
    1616
    17 dump-as-markup.js then replace the document body by the DOM tree on the page load.  If your test requires the test to be continued after the page load (e.g. uses setTimeout), then call Markup.waitUntilDone() before the page loads and Markup.notifyDone() to output the results and finish the test.  Markup's waitUntilDone and notifyDone automatically calls layoutTestController's counterparts.
     17dump-as-markup.js then outputs the DOM tree on the page load on DRT.  If your test requires the test to be continued after the page load (e.g. uses setTimeout), then call Markup.waitUntilDone() before the page loads and Markup.notifyDone() to output the results and finish the test.  Markup's waitUntilDone and notifyDone automatically calls layoutTestController's counterparts.
    1818
    1919For example, if I have:
     
    2626I get:
    2727{{{
    28 
    29 <HTML>
    30 <HEAD>
    31 <SCRIPT src="../../resources/dump-as-markup.js"></SCRIPT>
    32 <#text>
    33 </#text>
    34 </HEAD>
    35 <BODY>
    36 <DIV id="foo">
    37 <#text><selection-anchor>This is a dumpAsMarkup test.<selection-focus></#text>
    38 </DIV>
    39 <#text>
    40 </#text>
    41 <SCRIPT> window.getSelection().selectAllChildren(foo); </SCRIPT>
    42 <#text>
    43 </#text>
    44 </BODY>
    45 </HTML>
     28| <html>
     29|   <head>
     30|     <script>
     31|       src="../../resources/dump-as-markup.js"
     32|     "
     33"
     34|   <body>
     35|     <div>
     36|       id="foo"
     37|       "<#selection-anchor>This is a dumpAsMarkup test.<#selection-focus>"
     38|     "
     39"
     40|     <script>
     41|       " window.getSelection().selectAllChildren(foo); "
     42|     "
     43"
    4644}}}
    4745
    48 Notice <#text> and <selection-*> annotates the document.
     46Notice <selection-*> shows where the selection / caret is and double quotation wraps each text node on the page.
    4947
    5048== Output Subtree ==