ViewVC logotype

Diff of /trunk/doc/manual.html

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2 by siliconforks, Wed Aug 1 13:51:53 2007 UTC revision 14 by siliconforks, Tue Aug 14 14:46:04 2007 UTC
# Line 118  Line 118 
118  which is used to execute the instrumented code.  which is used to execute the instrumented code.
119  </p>  </p>
121  <h3>2. Executing instrumented code</h3>  <h3>2. Running instrumented code in the web application</h3>
123  <p>  <p>
124  Open <code>jscoverage.html</code> in your web browser.  Open <code>jscoverage.html</code> in your web browser.
# Line 215  Line 215 
215  <h3>3. Generating the coverage report</h3>  <h3>3. Generating the coverage report</h3>
217  <p>  <p>
218  Once you have executed the JavaScript code, you will be instructed to click on the  Once you have executed the JavaScript code, you are instructed to click on the
219  "Summary" tab.  "Summary" tab.
220  </p>  </p>
# Line 227  Line 227 
228  <img src="screenshot5.png" alt="Screenshot">  <img src="screenshot5.png" alt="Screenshot">
230    <h2>Inverted mode</h2>
232    <p>
233    In some circumstances it may be difficult to execute your code within the
234    JSCoverage "Browser" tab. For example, the code may assume that it is running in
235    the top-level browser window, generating errors if it is executed from within a
236    frame. JSCoverage has an alternative mode of operation, called <dfn>inverted
237    mode</dfn>, which may be useful in this situation.
238    </p>
240    <p>
241    Normally you load <code>jscoverage.html</code> in your web browser, and in its
242    "Browser" tab you launch your test code. In inverted mode, you do the
243    opposite: you load your test page directly in your web browser, and from there
244    you launch JSCoverage. To do this you need to add some code to your test page:
245    </p>
247    <pre>
248    window.open("path/to/jscoverage.html");
249    </pre>
251    <p>
252    The <code>"path/to/jscoverage.html"</code> should be a URL pointing to the
253    location of the <code>jscoverage.html</code> file (remember, this will be in the
254    top level of the <var>DESTINATION-DIRECTORY</var> you specified when running
255    the <code>jscoverage</code> executable).
256    </p>
258    <p>
259    You can place this code wherever you like in your page: for example, you could
260    attach it to a button:
261    </p>
263    <pre>
264    &lt;button onclick='window.open("path/to/jscoverage.html");'&gt;Coverage report&lt;/button&gt;
265    </pre>
267    <p>
268    An example is located in the <code>doc/example-inverted</code> directory.
269    You can instrument the code and launch the <code>index.html</code> page:
270    </p>
272    <pre>
273    jscoverage doc/example-inverted doc/instrumented-inverted
274    firefox "doc/instrumented-inverted/index.html"
275    </pre>
277    <p>
278    From this page, you select one of the radio buttons and then click the "Coverage
279    report" button to launch the JSCoverage report.
280    </p>
282  <h2>Caveats</h2>  <h2>Caveats</h2>
284  <ul>  <ul>

Removed from v.2  
changed lines
  Added in v.14

  ViewVC Help
Powered by ViewVC 1.1.24