@@ -332,25 +332,42 @@ describe('browser-window module', function () {
332
332
var after = w . getContentSize ( )
333
333
assert . equal ( after [ 0 ] , size [ 0 ] )
334
334
assert . equal ( after [ 1 ] , size [ 1 ] )
335
- assert . equal ( w . getContentBounds ( ) . width , size [ 0 ] )
336
- assert . equal ( w . getContentBounds ( ) . height , size [ 1 ] )
337
335
} )
338
336
339
- it ( 'works for framless window' , function ( ) {
337
+ it ( 'works for a frameless window' , function ( ) {
340
338
w . destroy ( )
341
339
w = new BrowserWindow ( {
342
340
show : false ,
343
341
frame : false ,
344
- width : 400 ,
345
- height : 400
342
+ width : 300 ,
343
+ height : 300
346
344
} )
347
345
var size = [ 400 , 400 ]
348
346
w . setContentSize ( size [ 0 ] , size [ 1 ] )
349
347
var after = w . getContentSize ( )
350
348
assert . equal ( after [ 0 ] , size [ 0 ] )
351
349
assert . equal ( after [ 1 ] , size [ 1 ] )
352
- assert . equal ( w . getContentBounds ( ) . width , size [ 0 ] )
353
- assert . equal ( w . getContentBounds ( ) . height , size [ 1 ] )
350
+ } )
351
+ } )
352
+
353
+ describe ( 'BrowserWindow.setContentBounds(bounds)' , function ( ) {
354
+ it ( 'sets the content size and position' , function ( ) {
355
+ var bounds = { x : 100 , y : 100 , width : 400 , height : 400 }
356
+ w . setContentBounds ( bounds )
357
+ assert . deepEqual ( w . getContentBounds ( ) , bounds )
358
+ } )
359
+
360
+ it ( 'works for a frameless window' , function ( ) {
361
+ w . destroy ( )
362
+ w = new BrowserWindow ( {
363
+ show : false ,
364
+ frame : false ,
365
+ width : 300 ,
366
+ height : 300
367
+ } )
368
+ var bounds = { x : 100 , y : 100 , width : 400 , height : 400 }
369
+ w . setContentBounds ( bounds )
370
+ assert . deepEqual ( w . getContentBounds ( ) , bounds )
354
371
} )
355
372
} )
356
373
@@ -396,7 +413,7 @@ describe('browser-window module', function () {
396
413
assert . equal ( size [ 1 ] , 400 )
397
414
} )
398
415
399
- it ( 'works for framless window' , function ( ) {
416
+ it ( 'works for a frameless window' , function ( ) {
400
417
w . destroy ( )
401
418
w = new BrowserWindow ( {
402
419
show : false ,
0 commit comments