Changes between Version 3 and Version 4 of Writing DumpAsMarkup Tests


Ignore:
Timestamp:
Aug 3, 2010, 2:40:26 PM (14 years ago)
Author:
rniwa@webkit.org
Comment:

Updated "Dump Multiple Times" to match the recent changes

Legend:

Unmodified
Added
Removed
Modified
  • Writing DumpAsMarkup Tests

    v3 v4  
    7272}}}
    7373
    74 Note "This is a dumpAsMarkup test." is added by Markup.description. The sentence will not be printed on DRT if we had it in a div like the earlier example because the document body is replaced by the output.
     74Note "This is a dumpAsMarkup test." is added by Markup.description. The sentence will not be printed on DRT if we had it in a div like the earlier example because the document body is replaced by the output.  Also note that the auto dump on the page load is disabled but you can still call Markup.waitUntilDone() and Markup.notifyDone() to avoid DRT finishing the test prematurely.
    7575
    7676== Dump Multiple Times ==
     
    8585<script>
    8686Markup.description('This test calls dump twice.')
    87 Markup.setNodeToDump('test')
    8887Markup.dump('test', 'before change')
    8988document.getElementById('test').lastChild.innerText += ' because of you!'
    90 Markup.dump(null, 'after change')
     89Markup.dump('test', 'after change')
    9190</script>
    9291}}}
     
    9796
    9897before change:
    99 <DIV id="test">
    100 <A href="http://webkit.org/">
    101 <#text>WebKit</#text>
    102 </A>
    103 <#text> is </#text>
    104 <STRONG>
    105 <#text>awesome</#text>
    106 </STRONG>
    107 </DIV>
     98| <a>
     99|   href="http://webkit.org/"
     100|   "WebKit"
     101| " is "
     102| <strong>
     103|   "awesome"
    108104
    109105after change:
    110 <DIV id="test">
    111 <A href="http://webkit.org/">
    112 <#text>WebKit</#text>
    113 </A>
    114 <#text> is </#text>
    115 <STRONG>
    116 <#text>awesome because of you!</#text>
    117 </STRONG>
    118 </DIV>
     106| <a>
     107|   href="http://webkit.org/"
     108|   "WebKit"
     109| " is "
     110| <strong>
     111|   "awesome because of you!"
    119112}}}
    120 
    121 Notice that I call dump twice and the DOM is dumped exactly twice (onload didn't dump).  You may still use Markup.waitUntilDone() and Markup.notifyDone() to avoid DRT finishing the test prematurely.
    122 
    123 '''Note''': as is implemented, the script adds pre element at the end of the document temporarily when you call dump and your script should not interfere with those pre tags.