11namespace ElectronNET . IntegrationTests . Tests
22{
33 using System . Runtime . InteropServices ;
4+ using System . Runtime . Versioning ;
45 using ElectronNET . API ;
56 using ElectronNET . API . Entities ;
7+ using ElectronNET . IntegrationTests . Common ;
68
79 [ Collection ( "ElectronCollection" ) ]
810 public class BrowserWindowTests
@@ -42,7 +44,7 @@ public async Task Can_set_progress_bar_and_clear()
4244 await Task . Delay ( 50 ) ;
4345 }
4446
45- [ Fact ( Timeout = 20000 ) ]
47+ [ SkipOnWslFact ( Timeout = 20000 ) ]
4648 public async Task Can_set_and_get_position ( )
4749 {
4850 this . fx . MainWindow . SetPosition ( 134 , 246 ) ;
@@ -91,7 +93,9 @@ public async Task AlwaysOnTop_toggle_and_query()
9193 ( await this . fx . MainWindow . IsAlwaysOnTopAsync ( ) ) . Should ( ) . BeFalse ( ) ;
9294 }
9395
94- [ Fact ( Timeout = 20000 ) ]
96+ [ SkippableFact ( Timeout = 20000 ) ]
97+ [ SupportedOSPlatform ( "Linux" ) ]
98+ [ SupportedOSPlatform ( "Windows" ) ]
9599 public async Task MenuBar_auto_hide_and_visibility ( )
96100 {
97101 this . fx . MainWindow . SetAutoHideMenuBar ( true ) ;
@@ -165,7 +169,9 @@ public async Task Progress_bar_and_always_on_top_toggle()
165169 ( await win . IsAlwaysOnTopAsync ( ) ) . Should ( ) . BeFalse ( ) ;
166170 }
167171
168- [ Fact ( Timeout = 20000 ) ]
172+ [ SkippableFact ( Timeout = 20000 ) ]
173+ [ SupportedOSPlatform ( "Linux" ) ]
174+ [ SupportedOSPlatform ( "Windows" ) ]
169175 public async Task Menu_bar_visibility_and_auto_hide ( )
170176 {
171177 var win = this . fx . MainWindow ;
@@ -188,36 +194,22 @@ public async Task Parent_child_relationship_roundtrip()
188194 child . Destroy ( ) ;
189195 }
190196
191- [ Fact ( Timeout = 20000 ) ]
197+ [ SkippableFact ( Timeout = 20000 ) ]
198+ [ SupportedOSPlatform ( "macOS" ) ]
192199 public async Task Represented_filename_and_edited_flags ( )
193200 {
194201 var win = this . fx . MainWindow ;
195202 var temp = Path . Combine ( Path . GetTempPath ( ) , "electronnet_test.txt" ) ;
196203 File . WriteAllText ( temp , "test" ) ;
197204 win . SetRepresentedFilename ( temp ) ;
198205 var represented = await win . GetRepresentedFilenameAsync ( ) ;
199- if ( RuntimeInformation . IsOSPlatform ( OSPlatform . OSX ) )
200- {
201- represented . Should ( ) . Be ( temp ) ;
202- }
203- else
204- {
205- // Non-macOS platforms may not support represented filename; empty is acceptable
206- represented . Should ( ) . BeEmpty ( ) ;
207- }
206+ represented . Should ( ) . Be ( temp ) ;
208207
209208 win . SetDocumentEdited ( true ) ;
210209 var edited = await win . IsDocumentEditedAsync ( ) ;
211- if ( RuntimeInformation . IsOSPlatform ( OSPlatform . OSX ) )
212- {
213- edited . Should ( ) . BeTrue ( ) ;
214- }
215- else
216- {
217- edited . Should ( ) . BeFalse ( ) ; // unsupported on non-mac platforms
218- }
210+ edited . Should ( ) . BeTrue ( ) ;
219211
220212 win . SetDocumentEdited ( false ) ;
221213 }
222214 }
223- }
215+ }
0 commit comments