Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add support for the Chrome browser in jstest.rb.

  • Loading branch information...
commit 413d2fd538aefaa96825dd3f86c0acd975ee83ec 1 parent deb47c6
@tobie tobie authored
Showing with 31 additions and 1 deletion.
  1. +2 −0  CHANGELOG
  2. +1 −1  Rakefile
  3. +28 −0 test/lib/jstest.rb
View
2  CHANGELOG
@@ -1,3 +1,5 @@
+* Add support for the Chrome browser in jstest.rb. (Andrew Dupont)
+
* Workaround a JavaScript exception in Opera. (Thomas Fuchs)
* Improve NodeList detection for Safari's $A function. (Garrett Smith, jddalton)
View
2  Rakefile 100644 → 100755
@@ -69,7 +69,7 @@ JavaScriptTestTask.new(:test_units => [:build_unit_tests]) do |t|
end
end
- %w( safari firefox ie konqueror opera ).each do |browser|
+ %w( safari firefox ie konqueror opera chrome ).each do |browser|
t.browser(browser.to_sym) unless browsers_to_test && !browsers_to_test.include?(browser)
end
end
View
28 test/lib/jstest.rb
@@ -50,6 +50,32 @@ def to_s
end
end
+class ChromeBrowser < Browser
+ def initialize(path = nil)
+ @path = path || File.join(
+ ENV['UserPath'] || "C:/Documents and Settings/Administrator",
+ "Local Settings",
+ "Application Data",
+ "Google",
+ "Chrome",
+ "Application",
+ "chrome.exe"
+ )
+ end
+
+ def supported?
+ windows?
+ end
+
+ def visit(url)
+ system("#{@path} #{url}")
+ end
+
+ def to_s
+ "Chrome"
+ end
+end
+
class SafariBrowser < Browser
def supported?
macos?
@@ -354,6 +380,8 @@ def browser(browser)
KonquerorBrowser.new
when :opera
OperaBrowser.new
+ when :chrome
+ ChromeBrowser.new
else
browser
end
Please sign in to comment.
Something went wrong with that request. Please try again.