[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

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.


data: URL tests

Abstract:
This document provides standards based testing of data URLs.
Mozilla specific issues (such as regression checks) are also included.

Audience:
QA testers needing a standards-based data test suite.
Mozilla users troubleshooting data: URL syntax and browser handling.

Name URL
Expected Behavior:
examples (from RFC)
A brief note
"Larry" image
Greek characters

launch helper app
"A brief note"
Image of Larry Masinter
Greek sample text "Έχώ"

hypothetical helper app
scheme only
data:
no data, no error.
data w/o data segment
data:,
data:text/plain,

data:;base64,

no data, no error.

data w/o leading comma
data:test
<mediatype> errors ignored.
data w/ traditionally reserved chaacters like ";"
data:,;test
reserved characters";" treated as *urlchar
need to add testcase w/ other typically reserved characters.
data w/ unneeded ";"
data:;,test
empty base64 and media type, ";" ignored.
default mediatype w/ default character set
data:text/plain,test
data:text/plain;charset=US-ASCII,test
both should return "test"
invalid character set
data:;charset=UTF-8,Hello
invalid character sets are ignored.
multiple commas
data:,a,b confirm parser takes data segment from first ","
base64
data:;base64 , data:;base64,
data:;base64,hello
data:text/html;base64,VGhpcyBpcyBhIHRlc3QK
empty base64 data ingnored.
incorrectly encoded base64 data ignored.
"This is a test"
all options
data:text/plain;charset=thing;base64;test
no error, no data
empty charset
data:;charset=,test
null characters ignored.
UTF8


combinations
use this test suite

Common media types

text/html
HTML in base6
<html><head><title>Test</title></head>
<body><p>This is a test</body></html>
png
small box
white square box
mp3
"the hats were my idea"
play (or download) small mp3 file
XUL
testcase "This works"
SVG
testcase "This works"
User Interface testing


URL bar escaping
data:,foo bar
URL bar should escape URL before rendering.

Bug lists:
"nsDataChannel" in summary
"data:" in summary
(There is no official naming convention, bug data: URL bugs should at least include "data:" somewhere in the summary, ideally on the left).
8649 - data: protocol handler added
144766 - meta bug

References:

RFC 2397 - The "data" URL scheme
Technical review of RFC 2397
About data: URLs and the mozilla implementation

Based on - Reading RFC's for testing

To Do:

make in-line data URL version, so all tests run as page is loaded, rather than forcing tester to click on each item manually.
limits to length of data URL.

ACKs
Thanks to bz, cbiesinger, and others who helped me write this document.