@@ -1010,27 +1010,78 @@ describe('BrowserWindow module', () => {
1010
1010
} ) ;
1011
1011
1012
1012
ifdescribe ( process . platform === 'win32' ) ( `Fullscreen state` , ( ) => {
1013
- it ( `checks normal bounds when fullscreen'ed` , ( done ) => {
1014
- const bounds = w . getBounds ( ) ;
1015
- w . once ( 'enter-full-screen' , ( ) => {
1016
- expectBoundsEqual ( w . getNormalBounds ( ) , bounds ) ;
1017
- done ( ) ;
1013
+ it ( 'with properties' , ( ) => {
1014
+ it ( 'can be set with the fullscreen constructor option' , ( ) => {
1015
+ w = new BrowserWindow ( { fullscreen : true } ) ;
1016
+ expect ( w . fullScreen ) . to . be . true ( ) ;
1017
+ } ) ;
1018
+
1019
+ it ( 'can be changed' , ( ) => {
1020
+ w . fullScreen = false ;
1021
+ expect ( w . fullScreen ) . to . be . false ( ) ;
1022
+ w . fullScreen = true ;
1023
+ expect ( w . fullScreen ) . to . be . true ( ) ;
1024
+ } ) ;
1025
+
1026
+ it ( `checks normal bounds when fullscreen'ed` , ( done ) => {
1027
+ const bounds = w . getBounds ( ) ;
1028
+ w . once ( 'enter-full-screen' , ( ) => {
1029
+ expectBoundsEqual ( w . getNormalBounds ( ) , bounds ) ;
1030
+ done ( ) ;
1031
+ } ) ;
1032
+ w . show ( ) ;
1033
+ w . fullScreen = true ;
1034
+ } ) ;
1035
+
1036
+ it ( `checks normal bounds when unfullscreen'ed` , ( done ) => {
1037
+ const bounds = w . getBounds ( ) ;
1038
+ w . once ( 'enter-full-screen' , ( ) => {
1039
+ w . fullScreen = false ;
1040
+ } ) ;
1041
+ w . once ( 'leave-full-screen' , ( ) => {
1042
+ expectBoundsEqual ( w . getNormalBounds ( ) , bounds ) ;
1043
+ done ( ) ;
1044
+ } ) ;
1045
+ w . show ( ) ;
1046
+ w . fullScreen = true ;
1018
1047
} ) ;
1019
- w . show ( ) ;
1020
- w . setFullScreen ( true ) ;
1021
1048
} ) ;
1022
1049
1023
- it ( `checks normal bounds when unfullscreen'ed` , ( done ) => {
1024
- const bounds = w . getBounds ( ) ;
1025
- w . once ( 'enter-full-screen' , ( ) => {
1050
+ it ( 'with functions' , ( ) => {
1051
+ it ( 'can be set with the fullscreen constructor option' , ( ) => {
1052
+ w = new BrowserWindow ( { fullscreen : true } ) ;
1053
+ expect ( w . isFullScreen ( ) ) . to . be . true ( ) ;
1054
+ } ) ;
1055
+
1056
+ it ( 'can be changed' , ( ) => {
1026
1057
w . setFullScreen ( false ) ;
1058
+ expect ( w . isFullScreen ( ) ) . to . be . false ( ) ;
1059
+ w . setFullScreen ( true ) ;
1060
+ expect ( w . isFullScreen ( ) ) . to . be . true ( ) ;
1027
1061
} ) ;
1028
- w . once ( 'leave-full-screen' , ( ) => {
1029
- expectBoundsEqual ( w . getNormalBounds ( ) , bounds ) ;
1030
- done ( ) ;
1062
+
1063
+ it ( `checks normal bounds when fullscreen'ed` , ( done ) => {
1064
+ const bounds = w . getBounds ( ) ;
1065
+ w . once ( 'enter-full-screen' , ( ) => {
1066
+ expectBoundsEqual ( w . getNormalBounds ( ) , bounds ) ;
1067
+ done ( ) ;
1068
+ } ) ;
1069
+ w . show ( ) ;
1070
+ w . setFullScreen ( true ) ;
1071
+ } ) ;
1072
+
1073
+ it ( `checks normal bounds when unfullscreen'ed` , ( done ) => {
1074
+ const bounds = w . getBounds ( ) ;
1075
+ w . once ( 'enter-full-screen' , ( ) => {
1076
+ w . setFullScreen ( false ) ;
1077
+ } ) ;
1078
+ w . once ( 'leave-full-screen' , ( ) => {
1079
+ expectBoundsEqual ( w . getNormalBounds ( ) , bounds ) ;
1080
+ done ( ) ;
1081
+ } ) ;
1082
+ w . show ( ) ;
1083
+ w . setFullScreen ( true ) ;
1031
1084
} ) ;
1032
- w . show ( ) ;
1033
- w . setFullScreen ( true ) ;
1034
1085
} ) ;
1035
1086
} ) ;
1036
1087
} ) ;
0 commit comments