Ticket #11552: added_support_for_cygwin.diff
| File added_support_for_cygwin.diff, 2.2 kB (added by kjeldahl, 3 months ago) |
|---|
-
test/javascript_test_test.rb
old new 17 17 18 18 def test_javascript_test_runner 19 19 assert runner_for(:success).successful? 20 # Ugly hack: waiting for port to be released 21 sleep 9 if (browser = JavaScriptTest::Browser.new; browser.cygwin? || browser.windows?) 20 22 assert !(runner_for(:failure).successful?) 21 23 end 22 24 -
lib/javascript_test.rb
old new 26 26 def linux? 27 27 host.include?('linux') 28 28 end 29 30 def cygwin? 31 host.include?('cygwin') 32 end 29 33 30 34 def applescript(script) 31 35 raise "Can't run AppleScript on #{host}" unless macos? … … 41 45 def visit(url) 42 46 applescript('tell application "Firefox" to Get URL "' + url + '"') if macos? 43 47 system("#{@path} #{url}") if windows? 48 system("'/cygdrive/c/Program Files/Mozilla Firefox/firefox' #{url}") if cygwin? 44 49 system("firefox #{url}") if linux? 45 50 end 46 51 … … 50 55 end 51 56 52 57 class SafariBrowser < Browser 58 def initialize(path='c:\Program Files\Safari\safari.exe') 59 @path = path 60 end 61 53 62 def supported? 54 macos? 63 macos? || windows? || cygwin? 55 64 end 56 65 57 66 def setup … … 59 68 end 60 69 61 70 def visit(url) 62 applescript('tell application "Safari" to set URL of front document to "' + url + '"') 63 end 71 applescript('tell application "Safari" to set URL of front document to "' + url + '"') if macos? 72 system("#{@path} #{url}") if windows? 73 system("'/cygdrive/c/Program Files/Safari/Safari.exe' #{url}") if cygwin? 74 end 64 75 65 76 def teardown 66 77 #applescript('tell application "Safari" to close front document') … … 89 100 end 90 101 91 102 def supported? 92 windows? 103 windows? || cygwin? 93 104 end 94 105 95 106 def visit(url) 96 107 system("#{@path} #{url}") if windows? 108 system("'/cygdrive/c/Program Files/Internet Explorer/IEXPLORE.EXE' #{url}") if cygwin? 97 109 end 98 110 99 111 def to_s