prototype: Fix jstest.rb Konqueror support. Closes #7140.

This commit is contained in:
Sam Stephenson 2007-04-28 02:37:53 +00:00
parent b76d34e7bb
commit b360a93999
2 changed files with 28 additions and 0 deletions

View File

@ -1,5 +1,7 @@
*SVN*
* Fix jstest.rb Konqueror support. Closes #7140. [Christophe Porteneuve]
* Fix regression in which no-argument calls to Element.addMethods() would not add the methods defined in Form.Methods and Form.Element.Methods. Closes #8206. [Tobie Langel, fwittekind]
* Fix Element#readAttribute to work with the 'type' attribute in IE. Closes #8160. [Tobie Langel, Wiktor Ihárosi]

View File

@ -1,6 +1,8 @@
require 'rake/tasklib'
require 'thread'
require 'webrick'
require 'fileutils'
include FileUtils
class Browser
def supported?; true; end
@ -100,9 +102,33 @@ class IEBrowser < Browser
end
class KonquerorBrowser < Browser
@@configDir = File.join(ENV['HOME'], '.kde', 'share', 'config')
@@globalConfig = File.join(@@configDir, 'kdeglobals')
@@konquerorConfig = File.join(@@configDir, 'konquerorrc')
def supported?
linux?
end
# Forces KDE's default browser to be Konqueror during the tests, and forces
# Konqueror to open external URL requests in new tabs instead of a new
# window.
def setup
cd @@configDir, :verbose => false do
copy @@globalConfig, "#{@@globalConfig}.bak", :preserve => true, :verbose => false
copy @@konquerorConfig, "#{@@konquerorConfig}.bak", :preserve => true, :verbose => false
# Too lazy to write it in Ruby... Is sed dependency so bad?
system "sed -ri /^BrowserApplication=/d '#{@@globalConfig}'"
system "sed -ri /^KonquerorTabforExternalURL=/s:false:true: '#{@@konquerorConfig}'"
end
end
def teardown
cd @@configDir, :verbose => false do
copy "#{@@globalConfig}.bak", @@globalConfig, :preserve => true, :verbose => false
copy "#{@@konquerorConfig}.bak", @@konquerorConfig, :preserve => true, :verbose => false
end
end
def visit(url)
system("kfmclient openURL #{url}")