Add support for the Chrome browser in jstest.rb.
This commit is contained in:
parent
deb47c6361
commit
413d2fd538
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -50,6 +50,32 @@ class FirefoxBrowser < Browser
|
|||
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 @@ class JavaScriptTestTask < ::Rake::TaskLib
|
|||
KonquerorBrowser.new
|
||||
when :opera
|
||||
OperaBrowser.new
|
||||
when :chrome
|
||||
ChromeBrowser.new
|
||||
else
|
||||
browser
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue