You are currently viewing a snapshot of www.mozilla.org taken on April 21, 2008. Most of this content is highly out of date (some pages haven't been updated since the project began in 1998) and exists for historical purposes only. If there are any pages on this archive site that you think should be added back to www.mozilla.org, please file a bug.



file: URL Test Cases
Chimera 0.6

Abstract:
This document provides file: URL tests in compliance with RFC 1738 and RFC 1630.

Before you start:
This test points to files that should be on a standard installation. In some cases, you need to create an extra test bed of files.
The next re-write will include recommended steps for the location and creation of the test bed.

Running the test:

Testing file URLs is complicated by the the checkloadURI feature, which disables file: URLs in network served (http: and https:) pages.
The test methodology is to take the test case (a string that could be a file: // URL) and paste it into the Location/URL bar and hit enter.
The fastest way of running the test is to select a URL by double clicking, then use keyboard shortcuts to:
Linux: copy the selection, select and clear the Location URL (control-l + backspace), and hit return).
Other: copy the selection, select the Location URL (control-l), paste the file: URL, and hit return.
Note: very long URLs have been formated as links, and you should "Copy Link Address".

 
Scheme tests
URL
Results
Comments
scheme-only
file
-> hostname "file"
  1. -> try http://file.localdomain.tld
  2. -> try http://www.file.com
Normal URL bar handling.
incomplete scheme-only formating
file:
file:/
file://
-> file:///
-> file:///
-> file:///
file: + 0-2 slashes -> "file:///", see 65152
works for Chimera 0.6
incomplete scheme+path
file:<path>
file:/<path>
Windows:
file:/C:/config.sys
file://C:/config.sys

Mac OS X:
file:///fileURLs/text.txt


-> file:///<path>
file:// URLs for directories cause layout pane to die.151291
Schemes with missing "/"s will be corrected when possible (file://<path> cannot be corrected, see below)
minimal URL
file:///

"file:///" displays blank page in Mac OS (X and classic) and Win32 13607
works for Chimera 0.6
<host> tests


file:// w/ fqdn file://hostname/ A file URL takes the form:

file://<host>/<path>

where <host> is the fully qualified domain name of the system on which the <path> is accessible, and <path> is a hierarchical directory path of the form <directory>/<directory>/.../<name>.

3.10

<host> is not checked: 70871
localhost file://localhost/  As a special case, <host> can be the string "localhost" or the empty  string; this is interpreted as `the machine from which the URL is being interpreted'.
3.10
MacOS X problems: 140606
non-hostname in hostname field
file://<filename>
file://<path>/<path>/<filename>


Since the file URL would accept the first part as a hostname, the file URL is valid, even if the author intended to use "file:///" as the prefix. Only exception is for DOS volumes (see next test)
DOS volume promotion
file://c|
file://c:

file://c|/
file://c:/
-> file:///c|/
-> file:///c:/
-> file:///c|/
-> file:///c:/

DOS volumes are moved from the host field to the first path segment (see 24431). The first two examples also are "/" (see next test)
Problems in Mac/Linux 102724
Path



DOS volume recognition file:///c: 
file:///C:/Program%20Files
-> file:///c:/
-> file:///C:/Program%20Files
adding a trailing "/" happens for DOS volume letters only
Mac OS X will not error: see 128909
"?"
Windows:
file:///c:/?
Macintosh:
file:///Macintosh%20HD/fileURLs/?
file:///Macintosh%20HD/fileURLs/testof%3F.txt

check as filename and as character in filename.

Problems"?" as path segment Win, Mac OS X 59002
Trailing charcters are ignored (query is ignored)
"#"
file:///C:/WINDOWS/Desktop/FileURLs/has%23.txt
file:///Macintosh%20HD/fileURLs/testof%23.txt


"#" must be escaped, unescaped "#" is a fragment (anchor)
" "
Windows: file:///C:/Program Files

":"
Windows: ":" is invalid
Macintosh OS ":" is invalid


trailing "."
file://FileURLs/trailing.

149586 fixed in 1.2b, affects Chimera
File Handling

File Handling QA
text Windows: file:///C:/Autoexec.bat
file:///etc/hosts


need sample URL for Mac Classic
other mime typefiletype sniffing Windows: file:///c:/WINDOWS/.appletviewer

file:///C:/WINDOWS/Desktop/FileURLs/mozilla-banner

mozilla-banner is a gif file w/o a gif extension
file:// needs decoder to sniff file types (see 83241)
executables file URL that is executable on OS
Windows:
file:///C:/command.com

use:
Mac OS classic file
Mac OS X file

see 59932 (also, MacOS 48165 )
(tries to save in RC1 Win32, Mac OS X classic apps)
Mac OS X apps are directories
User Interface



Reload
any directory
any file
opening file:///C:/, adding file, hit reload shows new files
editing a file and reloading should show new copy
directories had problem, see 90504
View Source
directories
files
<pending html view>
<unknown>
.
blank page, works in Linux
Win32 RC1 attempts to save file
Back + Forward
buttons should work

see Session:History for full testing
Exceptions


non-existent file file:///C:/Autoexec.bat
file:///AUTOEXEC.BAT2

should provide error message. fixed in
Non-existent DOS drive references do not error.
fixed in 63048
no drive/volume error needed, see 128909

empty file create empty file and open it
Windows: file:///C:/WINDOWS/Desktop/FileURLs/empty
displays empty page, that is not about:blank
should display only empty page (nothing else), see: 102737
full disk
test w/ floppy

white box problem: 100687
Preferences



file:// links in HTTP document
file:///c:/

directory view

file access
The file URL scheme is unusual in that it does not specify an Internet protocol or access method for such files; as such, its utility in network protocols between hosts is limited.

local files

security.checkloadURI=true will block file: URLs on network served pages.
use "about:config" to view pref easily
html view

network.dir.format - set to 1 if you want XUL dir.
not working for file yet. bug 10812 (needs qa review)

Results contain some quotes from RFC 1738.

To do:
Re-write test to use a standard testbed of files (and provide instructions for creating them on your local disk). -Windows paths updated, will post file archive soon.
Re-arrange tests to isolate platform specific tests.
Research syntaxtical aspects of local file systems (ongoing)

Last Update:
08.15.2002 - added sample local file paths for Mac OS and Win32.