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 |
Result (Expected/Observed) |
examples (from RFC) |
A
brief note "Larry" image Greek characters |
"A brief note" Image of Larry Masinter (corrected by lennox@cs.columbia.edu) |
scheme only |
data: |
should return error. (file bug) |
data w/o data segment |
data:, data:text/plain, data:;base64, |
crash (tb16026013z) |
data w/o leading comma |
data:test |
will be treated as pre-data
field of some kind. |
data w/ unneeded ";" |
data:,;test |
";" treated as *urlchar |
data w/ unneeded ";" |
data:;,test |
Illegal w/o base64 or media
type, ";" ignored for convenience |
data w/ text/plain | data:text/plain,test data:text/plain;charset=US-ASCII,test |
|
data:;charset=UTF-8,Hello |
illegal, but what the heck |
|
multiple commas |
data:,a,b | confirm parser takes data
segmenet from first "," |
base64 |
data:;base64 data:;base64,hello data:text/html;base64,VGhpcyBpcyBhIHRlc3QK data:text/plain;base64,VGhpcyBpcyBhIHRlc3QuCg== |
|
all options |
data:text/plain;charset=thing;base64;test |
no error, no completion |
empty charset |
data:;charset=,test |
|
UTF8 |
data:,A%20brief%20note | |
combinations |
use
this test suite |
|
Common media types | ||
text/html |
HTML in base64 | |
png |
small
box |
|
mp3 |
"the
hats were my idea" |
|
XUL |
testcase |
|
User Interface testing |
||
URL bar escaping |
data:,foo bar |
some utf-8 encoding should
happen, like if you bookmark... |
common error- UTF spaces in base64.
How to use uuencode needed for data: URL testing
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
Design considerations (http://bugzilla.mozilla.org/show_bug.cgi?id=73026#c12)
References:
RFC 2397 - The "data" URL scheme
Technical review of RFC 2397
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.
ACKs
Thanks to bz, cbiesinger, and others who helped me write this document.