mirror of
https://github.com/servo/servo.git
synced 2025-08-10 07:55:33 +01:00
Bug #1820, add the optional "type" parameter to Blob
This commit is contained in:
parent
37a97f3273
commit
6df9b7fd3a
6 changed files with 66 additions and 51 deletions
|
@ -10,6 +10,34 @@
|
|||
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>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue