/[jscoverage]/trunk/doc/faq.html
ViewVC logotype

Diff of /trunk/doc/faq.html

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

revision 29 by siliconforks, Sun Aug 19 04:41:05 2007 UTC revision 147 by siliconforks, Fri Jun 20 02:19:40 2008 UTC
# Line 1  Line 1 
1  <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">  <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
2  <html>  <html>
3  <head>  <head>
4  <title>JSCoverage - help</title>  <title>JSCoverage - FAQ</title>
5  <link rel="stylesheet" type="text/css" href="reset-fonts-grids.css">  <link rel="stylesheet" type="text/css" href="reset-fonts-grids.css">
6  <link rel="stylesheet" type="text/css" href="style.css">  <link rel="stylesheet" type="text/css" href="style.css">
7  </head>  </head>
# Line 13  Line 13 
13        <div id="jscoverage-main" class="yui-b">        <div id="jscoverage-main" class="yui-b">
14          <h2><abbr title="Frequently Asked Questions">FAQ</abbr></h2>          <h2><abbr title="Frequently Asked Questions">FAQ</abbr></h2>
15    
16          <h3>Can JSCoverage be used with <a href="http://www.jsunit.net/">JsUnit</a>?</h3>          <h3>Can I use JSCoverage to measure code coverage for a page on <code>http://<var>example.com</var>/</code>?</h3>
17    
18          <p>          <p>
19          It is necessary to run JSCoverage in <dfn>inverted mode</dfn>.  You will have to          In order to measure the code coverage of a page on <code>http://example.com/</code>,
20          modify JsUnit to launch JSCoverage.          you must run <code>jscoverage</code> to create a <code>jscoverage.html</code> file on the
21            <code>example.com</code> server.  You cannot use <code>http://example.org/jscoverage.html</code>
22            to measure the code coverage of a page located on <code>http://example.com/</code>.
23          </p>          </p>
24    
25          <p>          <p>
26          See the directory <code>doc/example-jsunit</code> for an example. It          The fundamental reason for this limitation is the
27          contains a copy of JsUnit version 2.2alpha11, with the file          <a href="http://www.mozilla.org/projects/security/components/same-origin.html">Same Origin Policy</a>
28          <code>jsunit/app/main-data.html</code> slightly modified to add a button          for untrusted JavaScript.
         which launches JSCoverage.  It also contains a simple unit test file <code>test.html</code>.  You  
         can instrument this example as follows:  
29          </p>          </p>
30    
31  <pre>          <p>
32  jscoverage --no-instrument=jsunit doc/example-jsunit doc/instrumented-jsunit          (In fact, the current version of JSCoverage is slightly more restrictive
33  </pre>          than this: it requires that the JavaScript being measured reside under the
34            same <strong>directory</strong> as the <code>jscoverage.html</code> file.)
35            </p>
36    
37         <p>          <h3>Why doesn't my test suite run under JSCoverage in Firefox 3?</h3>
38         You can then run the <code>test.html</code> file in JsUnit's <code>jsunit/testRunner.html</code>.  
39         The simplest way to do this is probably to copy the contents of <code>doc/instrumented-jsunit</code>          <p>
40         to the root of a web server and then access          Beta versions of Firefox 3 introduced <a
41         <a href="http://127.0.0.1/jsunit/testRunner.html?testPage=http://127.0.0.1/test.html&amp;autorun=true">this URL</a>.          href="http://tech.groups.yahoo.com/group/jsunit/message/1075">new
42         </p>          security restrictions</a> on local files.  Depending on the way your
43            test suite is organized, this may cause problems for JSCoverage.
44            (You may get the error "uncaught exception: Permission denied to get property Window._$jscoverage".)
45            These restrictions are not present in the final release of Firefox 3.
46            </p>
47    
48          <h3>I'm trying to load my code with the URL          <h3>I'm trying to load my code with the URL
49          <code>file:///C:/foo/bar/jscoverage.html?foo/bar.html</code>          <code>file:///C:/foo/bar/jscoverage.html?foo/bar.html</code>
# Line 51  Line 57 
57          As a workaround:          As a workaround:
58          </p>          </p>
59          <ul class="list">          <ul class="list">
60          <li>Place your files on a web server instead of loading them from the file system.          <li><p>Place your files on a web server instead of loading them from the file system.
61              (<code>http:</code> URLs work fine.)              (<code>http:</code> URLs work fine.)</p>
62          <li>Do not use a query string; enter your URL in the "URL" field in the "Browser" tab.          <li><p>Do not use a query string; enter your URL in the "URL" field in the "Browser" tab.</p>
63          <li>Rearrange your directory structure so that <code>bar.html</code>          <li><p>Rearrange your directory structure so that <code>bar.html</code>
64              ends up in the same directory as <code>jscoverage.html</code>; then              ends up in the same directory as <code>jscoverage.html</code>; then
65              you can use the URL              you can use the URL
66              <code>file:///C:/foo/bar/jscoverage.html?bar.html</code>              <code>file:///C:/foo/bar/jscoverage.html?bar.html</code>
67              with no slash in the query string.              with no slash in the query string.</p>
68          <li>Use a different browser.  (IE 7 seems to work.)          <li><p>Use a different browser.  (IE 7 seems to work.)</p>
69          </ul>          </ul>
70    
71          <h3>JSCoverage changes my cursor to a busy cursor, and it never changes back!</h3>          <h3>JSCoverage changes my cursor to a busy cursor, and it never changes back!</h3>
# Line 70  Line 76 
76          </p>          </p>
77    
78          <p>          <p>
79          See the discussion <a href="http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread/631908bd63241136/783c307480f95d8c">here</a> for more information.          See <a href="http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread/631908bd63241136/783c307480f95d8c">this discussion</a> for more information.
80          </p>          </p>
81    
82          <h3>JSCoverage hangs sometimes when rendering the coverage report.</h3>          <h3>JSCoverage hangs sometimes when rendering the coverage report.</h3>
# Line 80  Line 86 
86          (More information <a href="http://ajaxian.com/archives/garbage-collection-in-ie6">here</a>.)          (More information <a href="http://ajaxian.com/archives/garbage-collection-in-ie6">here</a>.)
87          </p>          </p>
88    
89            <h3>Can JSCoverage be used with <a href="http://www.jsunit.net/">JsUnit</a>?</h3>
90    
91            <p>
92            It is necessary to run JSCoverage in <dfn>inverted mode</dfn>.  You will have to
93            modify JsUnit to launch JSCoverage.
94            </p>
95    
96            <p>
97            See the directory <code>doc/example-jsunit</code> for an example. It
98            contains a copy of JsUnit version 2.2alpha11, with the file
99            <code>jsunit/app/main-data.html</code> slightly modified to add a button
100            which launches JSCoverage.  It also contains a simple unit test file <code>test.html</code>.  You
101            can instrument this example as follows:
102            </p>
103    
104    <pre>
105    jscoverage --no-instrument=jsunit doc/example-jsunit doc/instrumented-jsunit
106    </pre>
107    
108           <p>
109           You can then run the <code>test.html</code> file in JsUnit's <code>jsunit/testRunner.html</code>.
110           The simplest way to do this is probably to copy the contents of <code>doc/instrumented-jsunit</code>
111           to the root of a web server and then access the URL
112           </p>
113    
114    <pre>
115    http://127.0.0.1/jsunit/testRunner.html?testPage=http://127.0.0.1/test.html&amp;autoRun=true
116    </pre>
117    
118          <p>
119          After the test suite has been run, click on the "Coverage report" button
120          to get a coverage report.
121          </p>
122    
123        </div>        </div>
124      </div>      </div>
125      <div id="jscoverage-sidebar" class="yui-b">      <div id="jscoverage-sidebar" class="yui-b">
# Line 88  Line 128 
128        <li><a href="news.html">News</a> <a href="http://siliconforks.com/jscoverage/news.xml" type="application/rss+xml" title="RSS feed for JSCoverage"><img src="feed-icon-14x14.png" alt="RSS feed"></a>        <li><a href="news.html">News</a> <a href="http://siliconforks.com/jscoverage/news.xml" type="application/rss+xml" title="RSS feed for JSCoverage"><img src="feed-icon-14x14.png" alt="RSS feed"></a>
129        <li><a href="manual.html">Documentation</a>        <li><a href="manual.html">Documentation</a>
130        <li><a href="demo.html">Demo</a>        <li><a href="demo.html">Demo</a>
131        <li><a href="download.html">Download</a>        <li><a href="http://siliconforks.com/jscoverage/download.html">Download</a>
132        <li>FAQ        <li>FAQ
133        <li><a href="help.html">Help</a>        <li><a href="help.html">Help</a>
134        <li><a href="license.html">License</a>        <li><a href="license.html">License</a>
# Line 98  Line 138 
138    </div>      </div>  
139    <div id="ft">    <div id="ft">
140      <address>      <address>
141        Copyright &copy; 2007 siliconforks.com<br>        Copyright &copy; 2007, 2008 <a href="http://siliconforks.com/"><img src="siliconforks-16x16.png" width="16" height="16" class="icon" alt="Silicon Forks"></a> <a href="http://siliconforks.com/">siliconforks.com</a><br>
142        Last updated August 15, 2007<br>        Last updated June 18, 2008<br>
143        <a href="mailto:jscoverage@siliconforks.com">jscoverage@siliconforks.com</a>        <a href="mailto:jscoverage@siliconforks.com">jscoverage@siliconforks.com</a>
144      </address>      </address>
145    </div>      </div>  

Legend:
Removed from v.29  
changed lines
  Added in v.147

  ViewVC Help
Powered by ViewVC 1.1.24