File tree Expand file tree Collapse file tree 1 file changed +23
-2
lines changed
Expand file tree Collapse file tree 1 file changed +23
-2
lines changed Original file line number Diff line number Diff line change 1919 canCreateBlob : ! ! window . dataURLtoBlob
2020 }
2121
22- // black 60x40 GIF
22+ // black+white 60x40 GIF
2323 // Image data layout (B=black, F=white), scaled to 3x2:
2424 // BFF
2525 // BBB
2929 'stpXsLv9gr2q8UZshnDTjTUbWH7TqvS6/Y7P6/f8vv9vVwAAOw=='
3030 var imageUrlGIF = 'data:image/gif;base64,' + b64DataGIF
3131 var blobGIF = browser . canCreateBlob && window . dataURLtoBlob ( imageUrlGIF )
32+ var fileGIF
33+ try {
34+ fileGIF = new File ( [ blobGIF ] , 'image.gif' )
35+ } catch ( _ ) {
36+ // No File constructor support
37+ }
3238
3339 // black 3x2 GIF
3440 // Image data layout (B=black, F=white):
206212 ) . to . be . ok
207213 } )
208214
209- describe ( 'Object URL revoke' , function ( ) {
215+ describe ( 'File' , function ( ) {
216+ if ( ! fileGIF ) return
217+
218+ it ( 'Load image file as img element' , function ( done ) {
219+ expect (
220+ loadImage ( fileGIF , function ( img ) {
221+ expect ( img . nodeName . toLowerCase ( ) ) . to . equal ( 'img' )
222+ expect ( img . width ) . to . equal ( 60 )
223+ expect ( img . height ) . to . equal ( 40 )
224+ done ( )
225+ } )
226+ ) . to . be . ok
227+ } )
228+ } )
229+
230+ describe ( 'Object URL' , function ( ) {
210231 // Using XMLHttpRequest via the request helper function to test Object
211232 // URLs to work around Edge Legacy and IE caching image URLs.
212233 if ( ! window . XMLHttpRequest ) return
You can’t perform that action at this time.
0 commit comments