From b360a93999c4e4ebe31c6f6427416bdb03f8bd80 Mon Sep 17 00:00:00 2001 From: Sam Stephenson Date: Sat, 28 Apr 2007 02:37:53 +0000 Subject: [PATCH] prototype: Fix jstest.rb Konqueror support. Closes #7140. --- CHANGELOG | 2 ++ test/lib/jstest.rb | 26 ++++++++++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index a02620e..168c195 100644 --- a/CHANGELOG +++ b/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] diff --git a/test/lib/jstest.rb b/test/lib/jstest.rb index 4ed06eb..5128afa 100644 --- a/test/lib/jstest.rb +++ b/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 @@ -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}")