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 19
19
canCreateBlob : ! ! window . dataURLtoBlob
20
20
}
21
21
22
- // black 60x40 GIF
22
+ // black+white 60x40 GIF
23
23
// Image data layout (B=black, F=white), scaled to 3x2:
24
24
// BFF
25
25
// BBB
29
29
'stpXsLv9gr2q8UZshnDTjTUbWH7TqvS6/Y7P6/f8vv9vVwAAOw=='
30
30
var imageUrlGIF = 'data:image/gif;base64,' + b64DataGIF
31
31
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
+ }
32
38
33
39
// black 3x2 GIF
34
40
// Image data layout (B=black, F=white):
206
212
) . to . be . ok
207
213
} )
208
214
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 ( ) {
210
231
// Using XMLHttpRequest via the request helper function to test Object
211
232
// URLs to work around Edge Legacy and IE caching image URLs.
212
233
if ( ! window . XMLHttpRequest ) return
You can’t perform that action at this time.
0 commit comments