layout/doc/regression_tests.html

Tue, 06 Jan 2015 21:39:09 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 06 Jan 2015 21:39:09 +0100
branch
TOR_BUG_9701
changeset 8
97036ab72558
permissions
-rw-r--r--

Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.

michael@0 1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
michael@0 2 <!-- This Source Code Form is subject to the terms of the Mozilla Public
michael@0 3 - License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 4 - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
michael@0 5
michael@0 6 <html>
michael@0 7 <head>
michael@0 8 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
michael@0 9 <title>Layout Regression tests</title>
michael@0 10 <style type="text/css">
michael@0 11 body {font-family:arial}
michael@0 12 .screen {background-color:silver; color:blue}
michael@0 13 pre.screen {display:table-cell}
michael@0 14 </style>
michael@0 15
michael@0 16 </head>
michael@0 17 <body>
michael@0 18
michael@0 19 <h1>Table Regression Tests</h1>
michael@0 20 <h6>Bernd Mielke</h6>
michael@0 21 <h2>About This Document</h2>
michael@0 22 <p>
michael@0 23 This document describes my guerrilla approach to successfully running the table layout regression tests. It should encourage more people to run those tests.
michael@0 24
michael@0 25 <h2>Subject Overview</h2>
michael@0 26 <p>
michael@0 27 The table element and its children are one of the major layout components that can create some structure on the screen. They are widely (ab)used by page authors. Every small change in the table code can generate a bunch of bugzilla entries and a lot of seemingly unrelated dupes. With the high frequency of checkins in to the source tree it is difficult and time consuming to track the regression down to a single checkin. The risk of becoming very infamous can be reduced by running the layout regression tests.
michael@0 28
michael@0 29 <h2>Prerequisites</h2>
michael@0 30 <p>
michael@0 31 In order to run these tests, you will need to have:
michael@0 32 <ol>
michael@0 33 <li>a debug build with a working viewer, an optimized build will not work!
michael@0 34 <li>a mozilla tree with the testfiles at <code>%MOZ_SRC%/layout/html/tests</code>,
michael@0 35 <li> <code>DISABLE_TESTS</code> should not be defined,
michael@0 36 <li>patience and time.
michael@0 37 </ol>
michael@0 38
michael@0 39 <h2>Test Runs</h2>
michael@0 40
michael@0 41 <ul>
michael@0 42 <li>Go to the <code>%MOZ_SRC%/layout/html/tests/block</code> directory.
michael@0 43 <li> Avoid the nasty assertions to pop up by <code>set XPCOM_DEBUG_BREAK=warn</code>, the world would be a much better place if we could <a href="http://bugzilla.mozilla.org/show_bug.cgi?id=152015">first fix those assertions</a>.
michael@0 44 <li>The following shell scripts need a <code>sh</code> before the command under WinXX.
michael@0 45 <li>Execute <code>rtest.sh baseline</code>
michael@0 46 <li>Execute <code>rtest.sh verify&gt;outputfile.txt</code>
michael@0 47 <li>Make a note which tests have failed (these are false positives. If you are in bad mood file a bug against Chris Waterson about them)
michael@0 48 <li>you can grep the failures by:<br>
michael@0 49 <code>grep 'rgd failed' &lt;outputfile.txt &gt;false_positive.txt</code>
michael@0 50 <li> Make a copy of <code>gklayout.dll</code> and <code>gkcontent.dll</code> in the <code>dist</code> directory. If you would like to switch back, you will need them.
michael@0 51 <li>Make your changes to the source, compile and install.
michael@0 52 <li>execute in the <code>layout/html/tests/block</code> directory <code>rtest.sh verify &gt;regression.txt</code>
michael@0 53 <li>Check how many tests have failed and analyse your results:
michael@0 54 <ul>
michael@0 55 <li>If the regression tests have failed at the same place as the previous diagnosed false positives =&gt; ignore
michael@0 56 <ol>
michael@0 57 <li>copy <code>rtest.sh</code> to <code>my_rtest.sh</code>
michael@0 58 <li>create a new directory <code>my_files</code>.
michael@0 59 <li>create in this directory a file <code>file_list.txt</code>, where you put the url's of your remaining test failures
michael@0 60 <li>change <code>my_rtest.sh</code> to use only directory <code>my_files</code>
michael@0 61 <li>go back to the original gklayout.dll and gkcontent.dll and repeat the regression test procedure on a much smaller set now.
michael@0 62 </ol>
michael@0 63 <li>Try to figure out what the other regressions are: Are they
michael@0 64 improving the picture or are they regressions?
michael@0 65 <li>Note the difficult to explain testfailures.
michael@0 66 </ul>
michael@0 67 <li> Change the source if necessary until the regression tests indicate that your patch does not hork the block and table layout
michael@0 68 <li> Submit your patch and lists the remaining differences in the bug
michael@0 69 </ul>
michael@0 70
michael@0 71 <p>Be prepared to cycle.
michael@0 72
michael@0 73 <h2>How the layout regression tests work</h2>
michael@0 74
michael@0 75 <p>First the URL's to test are red from <code>file_list.txt</code>.<p>
michael@0 76 <table><caption>snippet from file_list.txt</caption><tr><td>
michael@0 77 <pre>file:///s|/mozilla/layout/html/tests/table/dom/appendCells1.html
michael@0 78 file:///s|/mozilla/layout/html/tests/table/dom/appendCellsRebuild1.html
michael@0 79 file:///s|/mozilla/layout/html/tests/table/dom/appendCol1.html
michael@0 80 file:///s|/mozilla/layout/html/tests/table/dom/appendCol2.html
michael@0 81 file:///s|/mozilla/layout/html/tests/table/dom/appendColGroup1.html
michael@0 82 file:///s|/mozilla/layout/html/tests/table/dom/appendRowsExpand1.html</pre>
michael@0 83 </td></tr></table>
michael@0 84 <p>The regression tests compare the frame tree dumps recorded at two different times. The URL's to test are red from <code>file_list.txt</code>
michael@0 85 For every file in <code>file_list.txt</code>viewer takes the root frame and dumps the whole tree via
michael@0 86 <a href="http://lxr.mozilla.org/seamonkey/search?string=nsFrame%3A%3ADumpRegression">
michael@0 87 nsFrame::DumpRegression</a>.
michael@0 88 <p>
michael@0 89 The frame tree dumps are invoked by the <code>-o</code> switch to the <code>viewer</code> (see <a href="http://lxr.mozilla.org/seamonkey/ident?i=PrintHelpInfo">commandline arguments </a>).
michael@0 90 When <code>-o</code> is specified together with a output directory for instance (<code>-o s:\mozilla\layout\html\tests\table\dom\</code>),
michael@0 91 the frame trees are dumped to separate files in that directory for all URL's in <code>file_list.txt</code> (see:
michael@0 92 <a href="http://lxr.mozilla.org/seamonkey/search?string=nsWebCrawler%3A%3ADumpRegression">
michael@0 93 nsWebCrawler::DumpRegressionData</a>) .
michael@0 94 <p>Their name is generated by replacing the old extension <code>.html</code> or <code>.xml</code> with <code>.rgd</code>. For <code>file:///s|/mozilla/layout/html/tests/table/dom/appendCells1.html</code> a file <code>appendCells1.rgd</code> will be created in the <code>s:\mozilla\layout\html\tests\table\dom\</code> directory.
michael@0 95
michael@0 96 <p>
michael@0 97 There is a special type of frame dumps - the printing regression tests, they are invoked by the <code>-Prt</code> command line argument to the <code>viewer</code> and include first a display then a frame dump taking into account the printer pages. A typical beginning of a dump (<code>*.rgd</code> file) looks like:<p>
michael@0 98 <pre class="screen">
michael@0 99 &lt;frame va="15022440" type="Viewport(-1)" state="270340" parent="0"&gt;
michael@0 100 &lt;view va="47171904"&gt;
michael@0 101 &lt;/view&gt;
michael@0 102 &lt;stylecontext va="15022232"&gt;
michael@0 103 &lt;font serif 240 240 0 /&gt;
michael@0 104 &lt;color data="-16777216"/&gt;
michael@0 105 &lt;background data="0 2 3 -1 0 0 "/&gt;
michael@0 106 &lt;spacing data="left: Null top: Null right: Null bottom: Null left: Null top: Null right: Null bottom: Null left: 1[0x1]enum top: 1[0x1]enum right: 1[0x1]enum bottom: 1[0x1]enum left: Null top: Null right: Null bottom: Null left: Null top: Null right: Null bottom: Null 1[0x1]enum 0" /&gt;
michael@0 107 &lt;list data="100 100 " /&gt;
michael@0 108 &lt;position data="left: Auto top: Auto right: Auto bottom: Auto Auto 0[0x0]tw Null Auto 0[0x0]tw Null 0 Auto " /&gt;
michael@0 109 &lt;text data="0 0 0 Normal Normal 0[0x0]tw Normal " /&gt;
michael@0 110 &lt;textreset data="0 10[0xa]enum " /&gt;
michael@0 111 &lt;display data="0 1 0 0 0 0 0 0 0 0 0 0 " /&gt;
michael@0 112 &lt;visibility data="0 1 1.000000" /&gt;
michael@0 113 &lt;table data="0 0 4 -1 1 " /&gt;
michael@0 114 &lt;tableborder data="1 Null Null 0 2 " /&gt;
michael@0 115 &lt;content data="0 0 0 Null " /&gt;
michael@0 116 &lt;quotes data="0 " /&gt;
michael@0 117 &lt;ui data="3 0 0 1 " /&gt;
michael@0 118 &lt;uireset data="7 0 4" /&gt;
michael@0 119 &lt;xul data="0 0 0 0 0 1 &lt;svg data="0 1.000000 1.000000 0 1.000000" /&gt;
michael@0 120 &lt;/stylecontext&gt;</pre>
michael@0 121 <p>The first run of the regression tests is started with the argument <code>baseline</code> and it creates the reference frame dumps.
michael@0 122 <p>The <code>baseline</code> log will look like:
michael@0 123 <pre class="screen">
michael@0 124 Type Manifest File: C:\MOZ_SOUR\MOZILLA\MOZILLA\DIST\WIN32_D.OBJ\BIN\components\xpti.dat
michael@0 125 nsNativeComponentLoader: autoregistering begins.
michael@0 126 nsNativeComponentLoader: autoregistering succeeded
michael@0 127 Going to create the event queue
michael@0 128 WEBSHELL+ = 1
michael@0 129 Note: verifyreflow is disabled
michael@0 130 Note: styleverifytree is disabled
michael@0 131 Note: frameverifytree is disabled
michael@0 132 +++ file:///s|/mozilla/layout/html/tests/table/dom/appendCells1.html: done loading (11810 msec)
michael@0 133 appendCells1.rgd - being written
michael@0 134 +++ file:///s|/mozilla/layout/html/tests/table/dom/appendCellsRebuild1.html: done loading (1260 msec)
michael@0 135 appendCellsRebuild1.rgd - being written
michael@0 136 +++ file:///s|/mozilla/layout/html/tests/table/dom/appendCol1.html: done loading (270 msec)
michael@0 137 appendCol1.rgd - being written
michael@0 138 +++ file:///s|/mozilla/layout/html/tests/table/dom/appendCol2.html: done loading (220 msec)
michael@0 139 appendCol2.rgd - being written
michael@0 140 +++ file:///s|/mozilla/layout/html/tests/table/dom/appendColGroup1.html: done loading (390 msec)
michael@0 141 appendColGroup1.rgd - being written
michael@0 142 +++ file:///s|/mozilla/layout/html/tests/table/dom/appendRowsExpand1.html: done loading (220 msec)
michael@0 143 appendRowsExpand1.rgd - being written
michael@0 144 </pre>
michael@0 145 <p>
michael@0 146 The second run with the argument <code>verify</code> creates first the frame dumps in a subdirectory (<code>verify</code>) and <a href="http://lxr.mozilla.org/seamonkey/search?string=nsFrameUtil%3A%3ACompareTrees">compares</a> each frame dump with the corresponding reference frame dump. If they differ in critical points the test fails.
michael@0 147 <p>A typical part of the <code>verify</code> log would look like:
michael@0 148 <pre class="screen">
michael@0 149 Type Manifest File: C:\MOZ_SOUR\MOZILLA\MOZILLA\DIST\WIN32_D.OBJ\BIN\components\xpti.dat
michael@0 150 nsNativeComponentLoader: autoregistering begins.
michael@0 151 nsNativeComponentLoader: autoregistering succeeded
michael@0 152 Going to create the event queue
michael@0 153 WEBSHELL+ = 1
michael@0 154 Note: verifyreflow is disabled
michael@0 155 Note: styleverifytree is disabled
michael@0 156 Note: frameverifytree is disabled
michael@0 157 +++ file:///s|/mozilla/layout/html/tests/table/dom/appendCells1.html: done loading (2200 msec)
michael@0 158 frame bbox mismatch: 0,285,930,435 vs. 0,285,1305,435
michael@0 159 Node 1:
michael@0 160 TableOuter(table)(1) 0x10004 0,285,930,435, |null attr|-16777216|left: 0[0x0]tw top: 0[0x0]tw right: 0[0x0]tw bottom: 0[0x0]tw left: 0[0x0]tw top: 0[0x0]tw right: 0[0x0]tw bottom: 0[0x0]tw left: 1[0x1]enum top: 1[0x1]enum right: 1[0x1]enum bottom: 1[0x1]enum left: Null top: Null right: Null bottom: Null left: Null top: Null right: Null bottom: Null 1[0x1]enum 0|100 100 |left: Inherit top: Inherit right: Inherit bottom: Inherit 0[0x0]tw 0[0x0]tw Null 0[0x0]tw 0[0x0]tw Null 0 Auto |0 0 0 Normal Normal 0[0x0]tw Normal |0 8 0 0 0 0 0 1 0 0 0 0 |0 0 4 -1 1 |0 0 0 Null
michael@0 161 Node 2:
michael@0 162 TableOuter(table)(1) 0x10004 0,285,1305,435, |null attr|-16777216|left: 0[0x0]tw top: 0[0x0]tw right: 0[0x0]tw bottom: 0[0x0]tw left: 0[0x0]tw top: 0[0x0]tw right: 0[0x0]tw bottom: 0[0x0]tw left: 1[0x1]enum top: 1[0x1]enum right: 1[0x1]enum bottom: 1[0x1]enum left: Null top: Null right: Null bottom: Null left: Null top: Null right: Null bottom: Null 1[0x1]enum 0|100 100 |left: Inherit top: Inherit right: Inherit bottom: Inherit 0[0x0]tw 0[0x0]tw Null 0[0x0]tw 0[0x0]tw Null 0 Auto |0 0 0 Normal Normal 0[0x0]tw Normal |0 8 0 0 0 0 0 1 0 0 0 0 |0 0 4 -1 1 |0 0 0 Null
michael@0 163 frame bbox mismatch: 0,0,930,435 vs. 0,0,1305,435
michael@0 164 Node 1:
michael@0 165 Table(table)(1) 0x10004 0,0,930,435, |null attr|-16777216|left: Null top: 0[0x0]tw right: Null bottom: 0[0x0]tw left: Null top: Null right: Null bottom: Null left: 15[0xf]tw top: 15[0xf]tw right: 15[0xf]tw bottom: 15[0xf]tw left: Null top: Null right: Null bottom: Null left: Null top: Null right: Null bottom: Null 1[0x1]enum 0|100 100 |left: Auto top: Auto right: Auto bottom: Auto Auto 0[0x0]tw Null Auto 0[0x0]tw Null 2 Auto |0 0 0 Normal Normal 0[0x0]tw Normal |0 8 0 0 0 0 0 0 0 0 0 0 |0 8 4 -1 1 |0 0 0 Null
michael@0 166 Node 2:
michael@0 167 Table(table)(1) 0x10004 0,0,1305,435, |null attr|-16777216|left: Null top: 0[0x0]tw right: Null bottom: 0[0x0]tw left: Null top: Null right: Null bottom: Null left: 15[0xf]tw top: 15[0xf]tw right: 15[0xf]tw bottom: 15[0xf]tw left: Null top: Null right: Null bottom: Null left: Null top: Null right: Null bottom: Null 1[0x1]enum 0|100 100 |left: Auto top: Auto right: Auto bottom: Auto Auto 0[0x0]tw Null Auto 0[0x0]tw Null 2 Auto |0 0 0 Normal Normal 0[0x0]tw Normal |0 8 0 0 0 0 0 0 0 0 0 0 |0 8 4 -1 1 |0 0 0 Null
michael@0 168 frame bbox mismatch: 45,15,840,405 vs. 45,15,1215,405
michael@0 169 Node 1:
michael@0 170 TableColGroup(table)(1) 0x80010004 45,15,840,405, |null attr|-16777216|left: Null top: Null right: Null bottom: Null left: Null top: Null right: Null bottom: Null left: 1[0x1]enum top: 1[0x1]enum right: 1[0x1]enum bottom: 1[0x1]enum left: Null top: Null right: Null bottom: Null left: Null top: Null right: Null bottom: Null 1[0x1]enum 0|100 100 |left: Auto top: Auto right: Auto bottom: Auto Auto 0[0x0]tw Null Auto 0[0x0]tw Null 0 Auto |0 0 0 Normal Normal 0[0x0]tw Normal |0 12 0 0 0 0 0 0 0 0 0 0 |0 0 4 -1 1 |0 0 0 Null
michael@0 171 Node 2:
michael@0 172 TableColGroup(table)(1) 0x80010004 45,15,1215,405, |null attr|-16777216|left: Null top: Null right: Null bottom: Null left: Null top: Null right: Null bottom: Null left: 1[0x1]enum top: 1[0x1]enum right: 1[0x1]enum bottom: 1[0x1]enum left: Null top: Null right: Null bottom: Null left: Null top: Null right: Null bottom: Null 1[0x1]enum 0|100 100 |left: Auto top: Auto right: Auto bottom: Auto Auto 0[0x0]tw Null Auto 0[0x0]tw Null 0 Auto |0 0 0 Normal Normal 0[0x0]tw Normal |0 12 0 0 0 0 0 0 0 0 0 0 |0 0 4 -1 1 |0 0 0 Null
michael@0 173 frame state mismatch: 0x30010406 vs. 0x30010004
michael@0 174 Node 1:
michael@0 175 TableCol(table)(1) 0x30010406 0,0,0,0, |null attr|-16777216|left: Null top: Null right: Null bottom: Null left: Null top: Null right: Null bottom: Null left: 1[0x1]enum top: 1[0x1]enum right: 1[0x1]enum bottom: 1[0x1]enum left: Null top: Null right: Null bottom: Null left: Null top: Null right: Null bottom: Null 1[0x1]enum 0|100 100 |left: Auto top: Auto right: Auto bottom: Auto Auto 0[0x0]tw Null Auto 0[0x0]tw Null 0 Auto |0 0 0 Normal Normal 0[0x0]tw Normal |0 11 0 0 0 0 0 0 0 0 0 0 |0 0 4 -1 1 |0 0 0 Null
michael@0 176 Node 2:
michael@0 177 TableCol(table)(1) 0x30010004 870,0,345,405, |null attr|-16777216|left: Null top: Null right: Null bottom: Null left: Null top: Null right: Null bottom: Null left: 1[0x1]enum top: 1[0x1]enum right: 1[0x1]enum bottom: 1[0x1]enum left: Null top: Null right: Null bottom: Null left: Null top: Null right: Null bottom: Null 1[0x1]enum 0|100 100 |left: Auto top: Auto right: Auto bottom: Auto Auto 0[0x0]tw Null Auto 0[0x0]tw Null 0 Auto |0 0 0 Normal Normal 0[0x0]tw Normal |0 11 0 0 0 0 0 0 0 0 0 0 |0 0 4 -1 1 |0 0 0 Null
michael@0 178 frame bbox mismatch: 0,0,0,0 vs. 870,0,345,405
michael@0 179 Node 1:
michael@0 180 TableCol(table)(1) 0x30010406 0,0,0,0, |null attr|-16777216|left: Null top: Null right: Null bottom: Null left: Null top: Null right: Null bottom: Null left: 1[0x1]enum top: 1[0x1]enum right: 1[0x1]enum bottom: 1[0x1]enum left: Null top: Null right: Null bottom: Null left: Null top: Null right: Null bottom: Null 1[0x1]enum 0|100 100 |left: Auto top: Auto right: Auto bottom: Auto Auto 0[0x0]tw Null Auto 0[0x0]tw Null 0 Auto |0 0 0 Normal Normal 0[0x0]tw Normal |0 11 0 0 0 0 0 0 0 0 0 0 |0 0 4 -1 1 |0 0 0 Null
michael@0 181 Node 2:
michael@0 182 TableCol(table)(1) 0x30010004 870,0,345,405, |null attr|-16777216|left: Null top: Null right: Null bottom: Null left: Null top: Null right: Null bottom: Null left: 1[0x1]enum top: 1[0x1]enum right: 1[0x1]enum bottom: 1[0x1]enum left: Null top: Null right: Null bottom: Null left: Null top: Null right: Null bottom: Null 1[0x1]enum 0|100 100 |left: Auto top: Auto right: Auto bottom: Auto Auto 0[0x0]tw Null Auto 0[0x0]tw Null 0 Auto |0 0 0 Normal Normal 0[0x0]tw Normal |0 11 0 0 0 0 0 0 0 0 0 0 |0 0 4 -1 1 |0 0 0 Null
michael@0 183 regression test s:\mozilla\layout\html\tests\table\dom\verify\appendCells1.rgd failed
michael@0 184 +++ file:///s|/mozilla/layout/html/tests/table/dom/appendCellsRebuild1.html: done loading (390 msec)
michael@0 185 044regression test s:\mozilla\layout\html\tests\table\dom\verify\appendCellsRebuild1.rgd passed
michael@0 186 +++ file:///s|/mozilla/layout/html/tests/table/dom/appendCol1.html: done loading (280 msec)
michael@0 187 regression test s:\mozilla\layout\html\tests\table\dom\verify\appendCol1.rgd passed
michael@0 188 +++ file:///s|/mozilla/layout/html/tests/table/dom/appendCol2.html: done loading (220 msec)
michael@0 189 regression test s:\mozilla\layout\html\tests\table\dom\verify\appendCol2.rgd passed
michael@0 190 +++ file:///s|/mozilla/layout/html/tests/table/dom/appendColGroup1.html: done loading (220 msec)
michael@0 191 regression test s:\mozilla\layout\html\tests\table\dom\verify\appendColGroup1.rgd passed
michael@0 192 </pre>
michael@0 193 <p>
michael@0 194 The first regression test has failed and it is marked so.
michael@0 195
michael@0 196
michael@0 197 <h2>Adding new regression tests</h2>
michael@0 198 <p>
michael@0 199 Once you have checked in the code:
michael@0 200 <ul>
michael@0 201 <li> please add your testcase for the bug to the regression tests.
michael@0 202 <li>A testcase should only contain local files.
michael@0 203 <li>Place the images in <code>table/images</code> (don't forget <code> cvs commit -kb </code>)
michael@0 204 <li>and the testfile in the <code>table/bugs</code> directory.
michael@0 205 <li>Update the <code>file_list<b>x</b>.txt</code> in order to include your file.
michael@0 206 </ul>
michael@0 207 <p>I would like to thank Chris Karnaze for his guidance and fantasai for his language support.
michael@0 208 <div style="text-align:right"><i>&lt;regression.html&gt;&nbsp; &lt;Last updated:
michael@0 209 2002-06-16 <a href="mailto:bernd.mielke@snafu.de">Bernd Mielke</a></i></div>
michael@0 210
michael@0 211 </body>
michael@0 212 </html>

mercurial