servo/tests/content/test_blob.html

43 lines
1.1 KiB
HTML

<html>
<head>
<script src="harness.js"></script>
<script>
var testData = ['<a id="a"><b id="b">hey!</b></a>'];
var b = new Blob(testData); // the blob
is(b.size, 32);
is(b.type, "");
var bs = b.slice(0, 5);
is(bs.size, 5);
is(b.type, "");
var bc = new Blob(testData, {type:"text/plain"}); // the blob
is(bc.size, 32);
is(bc.type, "text/plain");
var bss = new Blob(testData, {type:" text/plain "}); // spaces
is(bss.size, 32);
is(bss.type, " text/plain ");
var bcs = bc.slice(0, 7);
is(bcs.size, 7);
is(bcs.type, "");
var bcsc = bc.slice(0, 7, "text/xml");
is(bcsc.size, 7);
is(bcsc.type, "text/xml");
var bu = new Blob(testData, {type:"TEXT/PLAIN"}); // the blob
is(bu.size, 32);
is(bu.type, "text/plain");
var bj = new Blob(testData, {type:"☃"}); // the blob
is(bj.size, 32);
is(bj.type, "");
var bjs = bj.slice(0, 7, "☃");
is(bjs.size, 7);
is(bjs.type, "");
</script>
</head>
</html>