File tree Expand file tree Collapse file tree 1 file changed +22
-6
lines changed
src/ElectronNET.IntegrationTests/Tests Expand file tree Collapse file tree 1 file changed +22
-6
lines changed Original file line number Diff line number Diff line change @@ -82,12 +82,28 @@ public async Task Can_set_and_get_content_bounds()
8282 [ Fact ( Timeout = 20000 ) ]
8383 public async Task Show_hide_visibility_roundtrip ( )
8484 {
85- this . fx . MainWindow . Show ( ) ;
86- await Task . Delay ( 500 ) ;
87- ( await this . fx . MainWindow . IsVisibleAsync ( ) ) . Should ( ) . BeTrue ( ) ;
88- this . fx . MainWindow . Hide ( ) ;
89- await Task . Delay ( 500 ) ;
90- ( await this . fx . MainWindow . IsVisibleAsync ( ) ) . Should ( ) . BeFalse ( ) ;
85+ BrowserWindow window = null ;
86+
87+ try
88+ {
89+ window = await Electron . WindowManager . CreateWindowAsync ( new BrowserWindowOptions { Show = true } , "about:blank" ) ;
90+
91+ await Task . Delay ( 100 ) ;
92+
93+ window . Show ( ) ;
94+
95+ await Task . Delay ( 500 ) ;
96+ ( await window . IsVisibleAsync ( ) ) . Should ( ) . BeTrue ( ) ;
97+
98+ window . Hide ( ) ;
99+ await Task . Delay ( 500 ) ;
100+
101+ ( await window . IsVisibleAsync ( ) ) . Should ( ) . BeFalse ( ) ;
102+ }
103+ finally
104+ {
105+ window ? . Destroy ( ) ;
106+ }
91107 }
92108
93109 [ Fact ( Timeout = 20000 ) ]
You can’t perform that action at this time.
0 commit comments