QA/Firefox3.5/ViewSource Testplan: Difference between revisions

Line 23: Line 23:
   Describe how testcases will be created (litmus, mochitests, reftests, gristmill, etc..)
   Describe how testcases will be created (litmus, mochitests, reftests, gristmill, etc..)


There are three areas of testing.
== test strategy: overview ==


1. The source displayed must exactly match the source text originally retrieved by the browser. (Question: Can we really guarantee this?)
View Source functionality will be broken down into two major components:
2. Syntax highlighting is correct.
1. Existing (pre 3.1) view source functionality
2a. Syntax highlighting is correct for each type of token for HTML syntax that's correct.
1. URL linkification (new in 3.1)
2b. Syntax that is incorrect is highlighted appropriately.
 
3. The values of SRC and HREF attributes are always treated as URLs, and are represented in the view source display as actual clickable URLs. If a URL is to an HTML file, then clicking the URL should display the contents at that URL as source.  For other types of resources, the effect of clicking the URL should be the same as clicking it in the main window(Latter doesn't make sense for e.g. stylesheets, etc.)
Due to time constraints and resource limitation, this document will only attempt a cursory level of testing for existing view source functionality, with the understanding that this error will be fleshed out later.
 
Since the linkification feature is new and is likely to contain bugs, most of the test effort will be focused on it for 3.1.
 
== test strategy: existing pre-3.1 features ==
 
=== There are three ways to open the view source window ===
 
1. View >> Page Source from the main menu.
1. View Page Source from the content area context menu.
1. Ctrl-U/Cmd-U
 
=== There is also a way to view source in a regular browser window/tab ===
 
Enter a view-source:url in the address bar (directly, by bookmark, or by clicking a link which has a view-source:url as its HREF).
 
=== Basic Functionality ===
 
1. It should be possible to select text in the view source text.
1. It should be possible to copy the selected text.
1. Find and Find Again should work.
 
=== Fidelity: ensure that view-source does not corrupt the source ===
 
The text displayed by view-source should exactly match the source returned by the server or retrieved from the filesystemIt's possible for errors in the formatting code to cause characters to be omitted, for example.  This is particularly important because subtle errors in the displayed source text may be quite hard to detect, but could still cause users considerable difficulty.
 
The plan is to assemble a small, but reasonably representative, set of HTML source files as a test suite.  A mochitest or a series of mochitests will be written to automatically open view-source windows (possibly as IFRAMES) and extract (using document.body.textContent) the raw unformatted text.  The mochitests will then compare the extracted text content with the actual source text retrieved directly from the file system.
 
Ultimately the suite of test HTML files will be greatly expanded to ensure good coverageIt may make sense to include XML files as well (including SVG files).
 
There should be an emphasis on view-source fidelity because it is very amenable to automated testing, and because it's extremely important.


= Schedule Scoping =
= Schedule Scoping =
213

edits