= Benefits of dumpAsMarkup Tests = * Platform independent - dumpAsMarkup outputs plain text as the expected results and can be shared among all platforms. * Easier to read expected results - dumpAsMarkup's output is HTML with extra annotation. = Limitation = * Can't test rendering - Since dumpAsMarkup test does not produce .png files or render tree outputs, we can't use dumpAsMarkup to test the correctness of rendering. = How to Use = Including the following line makes your layout test a dumpAsMarkup test: {{{ }}} dump-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. For example, if I have: {{{
But cluttered expected result sucks :(
}}} I get: {{{ This is a dumpAsMarkup test.But cluttered expected result sucks :(
}}} I get: {{{ This test calls dump twice. before change: