26
26
using System . Text ;
27
27
using System . Threading ;
28
28
using OpenQA . Selenium . Firefox . Internal ;
29
+ using OpenQA . Selenium . Internal ;
29
30
30
31
namespace OpenQA . Selenium . Firefox
31
32
{
@@ -67,16 +68,6 @@ public FirefoxBinary(string pathToFirefoxBinary)
67
68
#endregion
68
69
69
70
#region Public properties
70
- /// <summary>
71
- /// Gets or sets the timeout (in milliseconds) to wait for command execution.
72
- /// </summary>
73
- [ Obsolete ( "Timeouts should be expressed as a TimeSpan. Use the Timeout property instead" ) ]
74
- public long TimeoutInMilliseconds
75
- {
76
- get { return Convert . ToInt64 ( this . Timeout . TotalMilliseconds ) ; }
77
- set { this . Timeout = TimeSpan . FromMilliseconds ( value ) ; }
78
- }
79
-
80
71
/// <summary>
81
72
/// Gets or sets the timeout to wait for Firefox to be available for command execution.
82
73
/// </summary>
@@ -299,28 +290,23 @@ private static string ExtractAndCheck(FirefoxProfile profile, string noFocusSoNa
299
290
{
300
291
string outSoPath = Path . Combine ( profile . ProfileDirectory , path ) ;
301
292
string file = Path . Combine ( outSoPath , noFocusSoName ) ;
302
-
303
293
string resourceName = string . Format ( CultureInfo . InvariantCulture , "WebDriver.FirefoxNoFocus.{0}.dll" , path ) ;
304
- Assembly executingAssembly = Assembly . GetExecutingAssembly ( ) ;
305
-
306
- List < string > resourceNames = new List < string > ( executingAssembly . GetManifestResourceNames ( ) ) ;
307
- if ( resourceNames . Contains ( resourceName ) )
294
+ if ( ResourceUtilities . IsValidResourceName ( resourceName ) )
308
295
{
309
- Stream libraryStream = executingAssembly . GetManifestResourceStream ( resourceName ) ;
310
-
311
- Directory . CreateDirectory ( outSoPath ) ;
312
- using ( FileStream outputStream = File . Create ( file ) )
296
+ using ( Stream libraryStream = ResourceUtilities . GetResourceStream ( noFocusSoName , resourceName ) )
313
297
{
314
- byte [ ] buffer = new byte [ 1000 ] ;
315
- int bytesRead = libraryStream . Read ( buffer , 0 , buffer . Length ) ;
316
- while ( bytesRead > 0 )
298
+ Directory . CreateDirectory ( outSoPath ) ;
299
+ using ( FileStream outputStream = File . Create ( file ) )
317
300
{
318
- outputStream . Write ( buffer , 0 , bytesRead ) ;
319
- bytesRead = libraryStream . Read ( buffer , 0 , buffer . Length ) ;
301
+ byte [ ] buffer = new byte [ 1000 ] ;
302
+ int bytesRead = libraryStream . Read ( buffer , 0 , buffer . Length ) ;
303
+ while ( bytesRead > 0 )
304
+ {
305
+ outputStream . Write ( buffer , 0 , bytesRead ) ;
306
+ bytesRead = libraryStream . Read ( buffer , 0 , buffer . Length ) ;
307
+ }
320
308
}
321
309
}
322
-
323
- libraryStream . Close ( ) ;
324
310
}
325
311
326
312
if ( ! File . Exists ( file ) )
@@ -343,7 +329,7 @@ private void ModifyLinkLibraryPath(FirefoxProfile profile)
343
329
string existingLdLibPath = Environment . GetEnvironmentVariable ( "LD_LIBRARY_PATH" ) ;
344
330
345
331
// The returned new ld lib path is terminated with ':'
346
- string newLdLibPath = ExtractAndCheck ( profile , NoFocusLibraryName , "x86" , "amd64 " ) ;
332
+ string newLdLibPath = ExtractAndCheck ( profile , NoFocusLibraryName , "x86" , "x64 " ) ;
347
333
if ( ! string . IsNullOrEmpty ( existingLdLibPath ) )
348
334
{
349
335
newLdLibPath += existingLdLibPath ;
0 commit comments