Skip to content

Commit

Permalink
prototype: Fix jstest.rb Konqueror support. Closes #7140.
Browse files Browse the repository at this point in the history
  • Loading branch information
sstephenson committed Apr 28, 2007
1 parent b76d34e commit b360a93
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG
@@ -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]
Expand Down
26 changes: 26 additions & 0 deletions test/lib/jstest.rb
@@ -1,6 +1,8 @@
require 'rake/tasklib'
require 'thread'
require 'webrick'
require 'fileutils'
include FileUtils

class Browser
def supported?; true; end
Expand Down Expand Up @@ -100,9 +102,33 @@ def to_s
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}")
Expand Down

0 comments on commit b360a93

Please sign in to comment.