Skip to content

Instantly share code, notes, and snippets.

@joahking
Created March 8, 2009 15:36
Show Gist options
  • Save joahking/75816 to your computer and use it in GitHub Desktop.
Save joahking/75816 to your computer and use it in GitHub Desktop.
does GMap breaks celerity/HtmlUnit ?
h1. We are spec-ing that celerity (HtmlUnit) does not break after a call to GMap API
Does specs pass for you??? any help would be appreciated :-)
on files you find the web app and the celerity specs.
h2. The rack app.
celerack.rb is a rack that returns a simple page with a form and 3 buttons:
# 1. submit one
# 2. with an onclick to normal js and then submits,
# 3. with a onclick that geolocates to GMap and then submits the form
save celerack.rb and run it with:
<pre>
ruby -Ilib celerack.rb
</pre>
the app will hear on locahost:3000
h2. Specs:
# spec that we get submitted when the submit button is clicked. Pass
# spec that we get submitted after some js. Pass
# spec that we get submitted after some GMap call. NO PASS!
specs are run for firefox and IE with same results.
as a bonus I've set the specs with :resynchronize => true
to get a stacktrace that something is happening inside GMap js...
run the specs with:
<pre>
jruby -S spec celerack_spec.rb
</pre>
h2. Spec stacktrace:
you notice the long GMap stacktrace?
require 'rubygems'
require 'rack/request'
require 'rack/response'
require 'ruby-debug'
module Rack
class Celerack
def call(env)
req = Request.new(env)
template = if req.env['PATH_INFO'] =~ /submit$/
"submitted"
else
TEMPLATE
end
res = Response.new
res.write template
res.finish
end
TEMPLATE = <<-PAGE
<title>celerity ajax GMap</title>
<script type='text/javascript' src='http://maps.google.com/maps?file=api&v=2.x&key=ABQIAAAA2mNUIoizUOwtxo-xS2R6ghTE51jtLpdZonu9w9RklIbb84MgORQd5bkI3AtQBzewGJkDE4RdS-HnZg&hl='></script>
<script type='text/javascript'>
function geolocate() {
var form = document.getElementById('form');
var geocoder = new GClientGeocoder();
geocoder.getLatLng('habana, cuba',
function(point) {
form['lat'].value = point.lat();
form['lng'].value = point.lng();
form.submit();
});
}
function noGeo() {
var form = document.getElementById('form');
form.submit();
}
</script>
<form id='form' method='get' action='/submit'>
<input id='lat' type='hidden' name='lat'/>
<input id='lng' type='hidden' name='lng'/>
<p>
<input id='nojs' type='submit' value='submit'/>
<input id='js' type='button' value='js' onclick='javascript:noGeo();'/>
<input id='gmap' type='button' value='gmap' onclick='javascript:geolocate();'/>
</p>
</form>
PAGE
end
end
if $0 == __FILE__
require 'rack'
require 'rack/showexceptions'
# Rack::Handler::Mongrel but then I loose console stdout
Rack::Handler::WEBrick.run \
Rack::ShowExceptions.new(Rack::Lint.new(Rack::Celerack.new)),
:Port => 3000
end
require 'spec'
require 'celerity'
describe 'firefox' do
describe 'submits' do
before(:each) do
@firefox = Celerity::Browser.new(:browser => "firefox",
:javascript_exceptions => true)
@firefox.goto 'localhost:3000'
end
it 'submit button' do
@firefox.button(:id, 'nojs').click
@firefox.text.include?('submitted').should be_true
end
it 'with js before' do
@firefox.button(:id, 'js').click
@firefox.text.include?('submitted').should be_true
end
# this is the never passing step
it 'with GMap query before' do
@firefox.button(:id, 'gmap').click
@firefox.text.include?('submitted').should be_true
end
end
end
describe 'ie' do
describe 'submits' do
before(:each) do
@ie = Celerity::Browser.new :javascript_exceptions => true
@ie.goto 'localhost:3000'
end
it 'submit button' do
@ie.button(:id, 'nojs').click
@ie.text.include?('submitted').should be_true
end
it 'with js before' do
@ie.button(:id, 'js').click
@ie.text.include?('submitted').should be_true
end
# this is the never passing step
it 'with GMap query before' do
@ie.button(:id, 'gmap').click
@ie.text.include?('submitted').should be_true
end
end
end
# here we are resync browser to see a GMap stack trace
describe 'resync_firefox' do
describe 'submits' do
before(:each) do
@resync_firefox = Celerity::Browser.new(:browser => "firefox",
:javascript_exceptions => true,
:resynchronize => true)
@resync_firefox.goto 'localhost:3000'
end
it 'submit button' do
@resync_firefox.button(:id, 'nojs').click
@resync_firefox.text.include?('submitted').should be_true
end
it 'with js before' do
@resync_firefox.button(:id, 'js').click
@resync_firefox.text.include?('submitted').should be_true
end
# this is the never passing step
it 'with GMap query before' do
@resync_firefox.button(:id, 'gmap').click
@resync_firefox.text.include?('submitted').should be_true
end
end
end
describe 'resync_ie' do
describe 'submits' do
before(:each) do
@resync_ie = Celerity::Browser.new( :javascript_exceptions => true,
:resynchronize => true )
@resync_ie.goto 'localhost:3000'
end
it 'submit button' do
@resync_ie.button(:id, 'nojs').click
@resync_ie.text.include?('submitted').should be_true
end
it 'with js before' do
@resync_ie.button(:id, 'js').click
@resync_ie.text.include?('submitted').should be_true
end
# this is the never passing step
it 'with GMap query before' do
@resync_ie.button(:id, 'gmap').click
@resync_ie.text.include?('submitted').should be_true
end
end
end
<pre>
..F..F.
Mar 8, 2009 4:18:07 PM com.gargoylesoftware.htmlunit.JavaScriptBackgroundJob run
SEVERE: Caught exception in Window.setTimeout().
======= EXCEPTION START ========
Exception class=[org.mozilla.javascript.WrappedException]
com.gargoylesoftware.htmlunit.ScriptException: Wrapped com.gargoylesoftware.htmlunit.ScriptException: ReferenceError: "GAddMessages" is not defined. (http://maps.google.com/intl/en_ALL/mapfiles/148e/maps2.api/mod_jslinker.js#1) (http://maps.google.com/intl/en_ALL/mapfiles/148e/maps2.api/main.js#155)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:528)
at org.mozilla.javascript.Context.call(Context.java:502)
at org.mozilla.javascript.ContextFactory.call(ContextFactory.java:511)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:437)
at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptFunctionIfPossible(HtmlPage.java:916)
at com.gargoylesoftware.htmlunit.JavaScriptBackgroundJob.run(JavaScriptBackgroundJob.java:105)
at java.lang.Thread.run(Thread.java:595)
at com.gargoylesoftware.htmlunit.ThreadManager$1.run(ThreadManager.java:127)
Caused by: org.mozilla.javascript.WrappedException: Wrapped com.gargoylesoftware.htmlunit.ScriptException: ReferenceError: "GAddMessages" is not defined. (http://maps.google.com/intl/en_ALL/mapfiles/148e/maps2.api/mod_jslinker.js#1) (http://maps.google.com/intl/en_ALL/mapfiles/148e/maps2.api/main.js#155)
at org.mozilla.javascript.Context.throwAsScriptRuntimeEx(Context.java:1657)
at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:176)
at org.mozilla.javascript.FunctionObject.call(FunctionObject.java:478)
at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:3335)
at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2484)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:164)
at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:401)
at com.gargoylesoftware.htmlunit.javascript.HtmlUnitContextFactory.doTopCall(HtmlUnitContextFactory.java:169)
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3004)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:162)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:465)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$6.doRun(JavaScriptEngine.java:430)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:522)
... 7 more
Caused by: com.gargoylesoftware.htmlunit.ScriptException: ReferenceError: "GAddMessages" is not defined. (http://maps.google.com/intl/en_ALL/mapfiles/148e/maps2.api/mod_jslinker.js#1)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:528)
at org.mozilla.javascript.Context.call(Context.java:502)
at org.mozilla.javascript.ContextFactory.call(ContextFactory.java:511)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScriptEngine.java:405)
at com.gargoylesoftware.htmlunit.html.HtmlPage.loadExternalJavaScriptFile(HtmlPage.java:959)
at com.gargoylesoftware.htmlunit.html.HtmlScript.executeScriptIfNeeded(HtmlScript.java:306)
at com.gargoylesoftware.htmlunit.html.HtmlScript.onAllChildrenAddedToPage(HtmlScript.java:206)
at com.gargoylesoftware.htmlunit.html.DomNode.appendChild(DomNode.java:857)
at com.gargoylesoftware.htmlunit.javascript.host.Node.jsxFunction_appendChild(Node.java:156)
at sun.reflect.GeneratedMethodAccessor8.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:161)
... 18 more
Caused by: org.mozilla.javascript.EcmaError: ReferenceError: "GAddMessages" is not defined. (http://maps.google.com/intl/en_ALL/mapfiles/148e/maps2.api/mod_jslinker.js#1)
at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3558)
at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3536)
at org.mozilla.javascript.ScriptRuntime.notFoundError(ScriptRuntime.java:3621)
at org.mozilla.javascript.ScriptRuntime.getNameFunctionAndThis(ScriptRuntime.java:2086)
at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:3161)
at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2484)
at org.mozilla.javascript.InterpretedFunction.exec(InterpretedFunction.java:178)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$5.doRun(JavaScriptEngine.java:396)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:522)
... 30 more
WrappedException: org.mozilla.javascript.WrappedException: Wrapped com.gargoylesoftware.htmlunit.ScriptException: ReferenceError: "GAddMessages" is not defined. (http://maps.google.com/intl/en_ALL/mapfiles/148e/maps2.api/mod_jslinker.js#1) (http://maps.google.com/intl/en_ALL/mapfiles/148e/maps2.api/main.js#155)
at org.mozilla.javascript.Context.throwAsScriptRuntimeEx(Context.java:1657)
at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:176)
at org.mozilla.javascript.FunctionObject.call(FunctionObject.java:478)
at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:3335)
at script(http://maps.google.com/intl/en_ALL/mapfiles/148e/maps2.api/main.js:155)
at script(http://maps.google.com/intl/en_ALL/mapfiles/148e/maps2.api/main.js:145)
at script.u(http://maps.google.com/intl/en_ALL/mapfiles/148e/maps2.api/main.js:105)
at script(http://maps.google.com/intl/en_ALL/mapfiles/148e/maps2.api/main.js:154)
at script(http://maps.google.com/intl/en_ALL/mapfiles/148e/maps2.api/main.js:88)
at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2484)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:164)
at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:401)
at com.gargoylesoftware.htmlunit.javascript.HtmlUnitContextFactory.doTopCall(HtmlUnitContextFactory.java:169)
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3004)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:162)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:465)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$6.doRun(JavaScriptEngine.java:430)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:522)
at org.mozilla.javascript.Context.call(Context.java:502)
at org.mozilla.javascript.ContextFactory.call(ContextFactory.java:511)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:437)
at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptFunctionIfPossible(HtmlPage.java:916)
at com.gargoylesoftware.htmlunit.JavaScriptBackgroundJob.run(JavaScriptBackgroundJob.java:105)
at java.lang.Thread.run(Thread.java:595)
at com.gargoylesoftware.htmlunit.ThreadManager$1.run(ThreadManager.java:127)
Caused by: com.gargoylesoftware.htmlunit.ScriptException: ReferenceError: "GAddMessages" is not defined. (http://maps.google.com/intl/en_ALL/mapfiles/148e/maps2.api/mod_jslinker.js#1)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:528)
at org.mozilla.javascript.Context.call(Context.java:502)
at org.mozilla.javascript.ContextFactory.call(ContextFactory.java:511)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScriptEngine.java:405)
at com.gargoylesoftware.htmlunit.html.HtmlPage.loadExternalJavaScriptFile(HtmlPage.java:959)
at com.gargoylesoftware.htmlunit.html.HtmlScript.executeScriptIfNeeded(HtmlScript.java:306)
at com.gargoylesoftware.htmlunit.html.HtmlScript.onAllChildrenAddedToPage(HtmlScript.java:206)
at com.gargoylesoftware.htmlunit.html.DomNode.appendChild(DomNode.java:857)
at com.gargoylesoftware.htmlunit.javascript.host.Node.jsxFunction_appendChild(Node.java:156)
at sun.reflect.GeneratedMethodAccessor8.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:161)
... 18 more
Caused by: org.mozilla.javascript.EcmaError: ReferenceError: "GAddMessages" is not defined. (http://maps.google.com/intl/en_ALL/mapfiles/148e/maps2.api/mod_jslinker.js#1)
at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3558)
at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3536)
at org.mozilla.javascript.ScriptRuntime.notFoundError(ScriptRuntime.java:3621)
at org.mozilla.javascript.ScriptRuntime.getNameFunctionAndThis(ScriptRuntime.java:2086)
at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:3161)
at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2484)
at org.mozilla.javascript.InterpretedFunction.exec(InterpretedFunction.java:178)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$5.doRun(JavaScriptEngine.java:396)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:522)
... 30 more
Inside wrapped exception:
======= EXCEPTION START ========
EcmaError: lineNumber=[1] column=[0] lineSource=[<no source>] name=[ReferenceError] sourceName=[http://maps.google.com/intl/en_ALL/mapfiles/148e/maps2.api/mod_jslinker.js] message=[ReferenceError: "GAddMessages" is not defined. (http://maps.google.com/intl/en_ALL/mapfiles/148e/maps2.api/mod_jslinker.js#1)]
com.gargoylesoftware.htmlunit.ScriptException: ReferenceError: "GAddMessages" is not defined. (http://maps.google.com/intl/en_ALL/mapfiles/148e/maps2.api/mod_jslinker.js#1)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:528)
at org.mozilla.javascript.Context.call(Context.java:502)
at org.mozilla.javascript.ContextFactory.call(ContextFactory.java:511)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScriptEngine.java:405)
at com.gargoylesoftware.htmlunit.html.HtmlPage.loadExternalJavaScriptFile(HtmlPage.java:959)
at com.gargoylesoftware.htmlunit.html.HtmlScript.executeScriptIfNeeded(HtmlScript.java:306)
at com.gargoylesoftware.htmlunit.html.HtmlScript.onAllChildrenAddedToPage(HtmlScript.java:206)
at com.gargoylesoftware.htmlunit.html.DomNode.appendChild(DomNode.java:857)
at com.gargoylesoftware.htmlunit.javascript.host.Node.jsxFunction_appendChild(Node.java:156)
at sun.reflect.GeneratedMethodAccessor8.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:161)
at org.mozilla.javascript.FunctionObject.call(FunctionObject.java:478)
at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:3335)
at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2484)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:164)
at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:401)
at com.gargoylesoftware.htmlunit.javascript.HtmlUnitContextFactory.doTopCall(HtmlUnitContextFactory.java:169)
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3004)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:162)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:465)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$6.doRun(JavaScriptEngine.java:430)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:522)
at org.mozilla.javascript.Context.call(Context.java:502)
at org.mozilla.javascript.ContextFactory.call(ContextFactory.java:511)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:437)
at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptFunctionIfPossible(HtmlPage.java:916)
at com.gargoylesoftware.htmlunit.JavaScriptBackgroundJob.run(JavaScriptBackgroundJob.java:105)
at java.lang.Thread.run(Thread.java:595)
at com.gargoylesoftware.htmlunit.ThreadManager$1.run(ThreadManager.java:127)
Caused by: org.mozilla.javascript.EcmaError: ReferenceError: "GAddMessages" is not defined. (http://maps.google.com/intl/en_ALL/mapfiles/148e/maps2.api/mod_jslinker.js#1)
at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3558)
at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3536)
at org.mozilla.javascript.ScriptRuntime.notFoundError(ScriptRuntime.java:3621)
at org.mozilla.javascript.ScriptRuntime.getNameFunctionAndThis(ScriptRuntime.java:2086)
at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:3161)
at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2484)
at org.mozilla.javascript.InterpretedFunction.exec(InterpretedFunction.java:178)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$5.doRun(JavaScriptEngine.java:396)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:522)
... 30 more
Enclosed exception:
org.mozilla.javascript.EcmaError: ReferenceError: "GAddMessages" is not defined. (http://maps.google.com/intl/en_ALL/mapfiles/148e/maps2.api/mod_jslinker.js#1)
at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3558)
at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3536)
at org.mozilla.javascript.ScriptRuntime.notFoundError(ScriptRuntime.java:3621)
at org.mozilla.javascript.ScriptRuntime.getNameFunctionAndThis(ScriptRuntime.java:2086)
at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:3161)
at script(http://maps.google.com/intl/en_ALL/mapfiles/148e/maps2.api/mod_jslinker.js:1)
at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2484)
at org.mozilla.javascript.InterpretedFunction.exec(InterpretedFunction.java:178)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$5.doRun(JavaScriptEngine.java:396)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:522)
at org.mozilla.javascript.Context.call(Context.java:502)
at org.mozilla.javascript.ContextFactory.call(ContextFactory.java:511)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScriptEngine.java:405)
at com.gargoylesoftware.htmlunit.html.HtmlPage.loadExternalJavaScriptFile(HtmlPage.java:959)
at com.gargoylesoftware.htmlunit.html.HtmlScript.executeScriptIfNeeded(HtmlScript.java:306)
at com.gargoylesoftware.htmlunit.html.HtmlScript.onAllChildrenAddedToPage(HtmlScript.java:206)
at com.gargoylesoftware.htmlunit.html.DomNode.appendChild(DomNode.java:857)
at com.gargoylesoftware.htmlunit.javascript.host.Node.jsxFunction_appendChild(Node.java:156)
at sun.reflect.GeneratedMethodAccessor8.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:161)
at org.mozilla.javascript.FunctionObject.call(FunctionObject.java:478)
at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:3335)
at script(http://maps.google.com/intl/en_ALL/mapfiles/148e/maps2.api/main.js:155)
at script(http://maps.google.com/intl/en_ALL/mapfiles/148e/maps2.api/main.js:145)
at script.u(http://maps.google.com/intl/en_ALL/mapfiles/148e/maps2.api/main.js:105)
at script(http://maps.google.com/intl/en_ALL/mapfiles/148e/maps2.api/main.js:154)
at script(http://maps.google.com/intl/en_ALL/mapfiles/148e/maps2.api/main.js:88)
at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2484)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:164)
at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:401)
at com.gargoylesoftware.htmlunit.javascript.HtmlUnitContextFactory.doTopCall(HtmlUnitContextFactory.java:169)
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3004)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:162)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:465)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$6.doRun(JavaScriptEngine.java:430)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:522)
at org.mozilla.javascript.Context.call(Context.java:502)
at org.mozilla.javascript.ContextFactory.call(ContextFactory.java:511)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:437)
at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptFunctionIfPossible(HtmlPage.java:916)
at com.gargoylesoftware.htmlunit.JavaScriptBackgroundJob.run(JavaScriptBackgroundJob.java:105)
at java.lang.Thread.run(Thread.java:595)
at com.gargoylesoftware.htmlunit.ThreadManager$1.run(ThreadManager.java:127)
======= EXCEPTION END ========
== CALLING JAVASCRIPT ==
function () {
b.call(a);
}
======= EXCEPTION END ========
.F.Mar 8, 2009 4:18:11 PM com.gargoylesoftware.htmlunit.JavaScriptBackgroundJob run
SEVERE: Caught exception in Window.setTimeout().
======= EXCEPTION START ========
Exception class=[org.mozilla.javascript.WrappedException]
com.gargoylesoftware.htmlunit.ScriptException: Wrapped com.gargoylesoftware.htmlunit.ScriptException: ReferenceError: "GAddMessages" is not defined. (http://maps.google.com/intl/en_ALL/mapfiles/148e/maps2.api/mod_jslinker.js#1) (http://maps.google.com/intl/en_ALL/mapfiles/148e/maps2.api/main.js#155)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:528)
at org.mozilla.javascript.Context.call(Context.java:502)
at org.mozilla.javascript.ContextFactory.call(ContextFactory.java:511)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:437)
at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptFunctionIfPossible(HtmlPage.java:916)
at com.gargoylesoftware.htmlunit.JavaScriptBackgroundJob.run(JavaScriptBackgroundJob.java:105)
at java.lang.Thread.run(Thread.java:595)
at com.gargoylesoftware.htmlunit.ThreadManager$1.run(ThreadManager.java:127)
Caused by: org.mozilla.javascript.WrappedException: Wrapped com.gargoylesoftware.htmlunit.ScriptException: ReferenceError: "GAddMessages" is not defined. (http://maps.google.com/intl/en_ALL/mapfiles/148e/maps2.api/mod_jslinker.js#1) (http://maps.google.com/intl/en_ALL/mapfiles/148e/maps2.api/main.js#155)
at org.mozilla.javascript.Context.throwAsScriptRuntimeEx(Context.java:1657)
at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:176)
at org.mozilla.javascript.FunctionObject.call(FunctionObject.java:478)
at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:3335)
at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2484)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:164)
at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:401)
at com.gargoylesoftware.htmlunit.javascript.HtmlUnitContextFactory.doTopCall(HtmlUnitContextFactory.java:169)
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3004)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:162)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:465)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$6.doRun(JavaScriptEngine.java:430)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:522)
... 7 more
Caused by: com.gargoylesoftware.htmlunit.ScriptException: ReferenceError: "GAddMessages" is not defined. (http://maps.google.com/intl/en_ALL/mapfiles/148e/maps2.api/mod_jslinker.js#1)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:528)
at org.mozilla.javascript.Context.call(Context.java:502)
at org.mozilla.javascript.ContextFactory.call(ContextFactory.java:511)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScriptEngine.java:405)
at com.gargoylesoftware.htmlunit.html.HtmlPage.loadExternalJavaScriptFile(HtmlPage.java:959)
at com.gargoylesoftware.htmlunit.html.HtmlScript.executeScriptIfNeeded(HtmlScript.java:306)
at com.gargoylesoftware.htmlunit.html.HtmlScript.onAllChildrenAddedToPage(HtmlScript.java:206)
at com.gargoylesoftware.htmlunit.html.DomNode.appendChild(DomNode.java:857)
at com.gargoylesoftware.htmlunit.javascript.host.Node.jsxFunction_appendChild(Node.java:156)
at sun.reflect.GeneratedMethodAccessor8.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:161)
... 18 more
Caused by: org.mozilla.javascript.EcmaError: ReferenceError: "GAddMessages" is not defined. (http://maps.google.com/intl/en_ALL/mapfiles/148e/maps2.api/mod_jslinker.js#1)
at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3558)
at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3536)
at org.mozilla.javascript.ScriptRuntime.notFoundError(ScriptRuntime.java:3621)
at org.mozilla.javascript.ScriptRuntime.getNameFunctionAndThis(ScriptRuntime.java:2086)
at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:3161)
at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2484)
at org.mozilla.javascript.InterpretedFunction.exec(InterpretedFunction.java:178)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$5.doRun(JavaScriptEngine.java:396)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:522)
... 30 more
WrappedException: org.mozilla.javascript.WrappedException: Wrapped com.gargoylesoftware.htmlunit.ScriptException: ReferenceError: "GAddMessages" is not defined. (http://maps.google.com/intl/en_ALL/mapfiles/148e/maps2.api/mod_jslinker.js#1) (http://maps.google.com/intl/en_ALL/mapfiles/148e/maps2.api/main.js#155)
at org.mozilla.javascript.Context.throwAsScriptRuntimeEx(Context.java:1657)
at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:176)
at org.mozilla.javascript.FunctionObject.call(FunctionObject.java:478)
at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:3335)
at script(http://maps.google.com/intl/en_ALL/mapfiles/148e/maps2.api/main.js:155)
at script(http://maps.google.com/intl/en_ALL/mapfiles/148e/maps2.api/main.js:145)
at script.u(http://maps.google.com/intl/en_ALL/mapfiles/148e/maps2.api/main.js:105)
at script(http://maps.google.com/intl/en_ALL/mapfiles/148e/maps2.api/main.js:154)
at script(http://maps.google.com/intl/en_ALL/mapfiles/148e/maps2.api/main.js:88)
at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2484)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:164)
at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:401)
at com.gargoylesoftware.htmlunit.javascript.HtmlUnitContextFactory.doTopCall(HtmlUnitContextFactory.java:169)
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3004)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:162)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:465)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$6.doRun(JavaScriptEngine.java:430)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:522)
at org.mozilla.javascript.Context.call(Context.java:502)
at org.mozilla.javascript.ContextFactory.call(ContextFactory.java:511)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:437)
at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptFunctionIfPossible(HtmlPage.java:916)
at com.gargoylesoftware.htmlunit.JavaScriptBackgroundJob.run(JavaScriptBackgroundJob.java:105)
at java.lang.Thread.run(Thread.java:595)
at com.gargoylesoftware.htmlunit.ThreadManager$1.run(ThreadManager.java:127)
Caused by: com.gargoylesoftware.htmlunit.ScriptException: ReferenceError: "GAddMessages" is not defined. (http://maps.google.com/intl/en_ALL/mapfiles/148e/maps2.api/mod_jslinker.js#1)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:528)
at org.mozilla.javascript.Context.call(Context.java:502)
at org.mozilla.javascript.ContextFactory.call(ContextFactory.java:511)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScriptEngine.java:405)
at com.gargoylesoftware.htmlunit.html.HtmlPage.loadExternalJavaScriptFile(HtmlPage.java:959)
at com.gargoylesoftware.htmlunit.html.HtmlScript.executeScriptIfNeeded(HtmlScript.java:306)
at com.gargoylesoftware.htmlunit.html.HtmlScript.onAllChildrenAddedToPage(HtmlScript.java:206)
at com.gargoylesoftware.htmlunit.html.DomNode.appendChild(DomNode.java:857)
at com.gargoylesoftware.htmlunit.javascript.host.Node.jsxFunction_appendChild(Node.java:156)
at sun.reflect.GeneratedMethodAccessor8.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:161)
... 18 more
Caused by: org.mozilla.javascript.EcmaError: ReferenceError: "GAddMessages" is not defined. (http://maps.google.com/intl/en_ALL/mapfiles/148e/maps2.api/mod_jslinker.js#1)
at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3558)
at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3536)
at org.mozilla.javascript.ScriptRuntime.notFoundError(ScriptRuntime.java:3621)
at org.mozilla.javascript.ScriptRuntime.getNameFunctionAndThis(ScriptRuntime.java:2086)
at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:3161)
at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2484)
at org.mozilla.javascript.InterpretedFunction.exec(InterpretedFunction.java:178)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$5.doRun(JavaScriptEngine.java:396)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:522)
... 30 more
Inside wrapped exception:
======= EXCEPTION START ========
EcmaError: lineNumber=[1] column=[0] lineSource=[<no source>] name=[ReferenceError] sourceName=[http://maps.google.com/intl/en_ALL/mapfiles/148e/maps2.api/mod_jslinker.js] message=[ReferenceError: "GAddMessages" is not defined. (http://maps.google.com/intl/en_ALL/mapfiles/148e/maps2.api/mod_jslinker.js#1)]
com.gargoylesoftware.htmlunit.ScriptException: ReferenceError: "GAddMessages" is not defined. (http://maps.google.com/intl/en_ALL/mapfiles/148e/maps2.api/mod_jslinker.js#1)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:528)
at org.mozilla.javascript.Context.call(Context.java:502)
at org.mozilla.javascript.ContextFactory.call(ContextFactory.java:511)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScriptEngine.java:405)
at com.gargoylesoftware.htmlunit.html.HtmlPage.loadExternalJavaScriptFile(HtmlPage.java:959)
at com.gargoylesoftware.htmlunit.html.HtmlScript.executeScriptIfNeeded(HtmlScript.java:306)
at com.gargoylesoftware.htmlunit.html.HtmlScript.onAllChildrenAddedToPage(HtmlScript.java:206)
at com.gargoylesoftware.htmlunit.html.DomNode.appendChild(DomNode.java:857)
at com.gargoylesoftware.htmlunit.javascript.host.Node.jsxFunction_appendChild(Node.java:156)
at sun.reflect.GeneratedMethodAccessor8.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:161)
at org.mozilla.javascript.FunctionObject.call(FunctionObject.java:478)
at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:3335)
at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2484)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:164)
at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:401)
at com.gargoylesoftware.htmlunit.javascript.HtmlUnitContextFactory.doTopCall(HtmlUnitContextFactory.java:169)
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3004)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:162)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:465)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$6.doRun(JavaScriptEngine.java:430)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:522)
at org.mozilla.javascript.Context.call(Context.java:502)
at org.mozilla.javascript.ContextFactory.call(ContextFactory.java:511)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:437)
at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptFunctionIfPossible(HtmlPage.java:916)
at com.gargoylesoftware.htmlunit.JavaScriptBackgroundJob.run(JavaScriptBackgroundJob.java:105)
at java.lang.Thread.run(Thread.java:595)
at com.gargoylesoftware.htmlunit.ThreadManager$1.run(ThreadManager.java:127)
Caused by: org.mozilla.javascript.EcmaError: ReferenceError: "GAddMessages" is not defined. (http://maps.google.com/intl/en_ALL/mapfiles/148e/maps2.api/mod_jslinker.js#1)
at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3558)
at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3536)
at org.mozilla.javascript.ScriptRuntime.notFoundError(ScriptRuntime.java:3621)
at org.mozilla.javascript.ScriptRuntime.getNameFunctionAndThis(ScriptRuntime.java:2086)
at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:3161)
at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2484)
at org.mozilla.javascript.InterpretedFunction.exec(InterpretedFunction.java:178)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$5.doRun(JavaScriptEngine.java:396)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:522)
... 30 more
Enclosed exception:
org.mozilla.javascript.EcmaError: ReferenceError: "GAddMessages" is not defined. (http://maps.google.com/intl/en_ALL/mapfiles/148e/maps2.api/mod_jslinker.js#1)
at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3558)
at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3536)
at org.mozilla.javascript.ScriptRuntime.notFoundError(ScriptRuntime.java:3621)
at org.mozilla.javascript.ScriptRuntime.getNameFunctionAndThis(ScriptRuntime.java:2086)
at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:3161)
at script(http://maps.google.com/intl/en_ALL/mapfiles/148e/maps2.api/mod_jslinker.js:1)
at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2484)
at org.mozilla.javascript.InterpretedFunction.exec(InterpretedFunction.java:178)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$5.doRun(JavaScriptEngine.java:396)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:522)
at org.mozilla.javascript.Context.call(Context.java:502)
at org.mozilla.javascript.ContextFactory.call(ContextFactory.java:511)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScriptEngine.java:405)
at com.gargoylesoftware.htmlunit.html.HtmlPage.loadExternalJavaScriptFile(HtmlPage.java:959)
at com.gargoylesoftware.htmlunit.html.HtmlScript.executeScriptIfNeeded(HtmlScript.java:306)
at com.gargoylesoftware.htmlunit.html.HtmlScript.onAllChildrenAddedToPage(HtmlScript.java:206)
at com.gargoylesoftware.htmlunit.html.DomNode.appendChild(DomNode.java:857)
at com.gargoylesoftware.htmlunit.javascript.host.Node.jsxFunction_appendChild(Node.java:156)
at sun.reflect.GeneratedMethodAccessor8.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:161)
at org.mozilla.javascript.FunctionObject.call(FunctionObject.java:478)
at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:3335)
at script(http://maps.google.com/intl/en_ALL/mapfiles/148e/maps2.api/main.js:155)
at script(http://maps.google.com/intl/en_ALL/mapfiles/148e/maps2.api/main.js:145)
at script.u(http://maps.google.com/intl/en_ALL/mapfiles/148e/maps2.api/main.js:105)
at script(http://maps.google.com/intl/en_ALL/mapfiles/148e/maps2.api/main.js:154)
at script(http://maps.google.com/intl/en_ALL/mapfiles/148e/maps2.api/main.js:88)
at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2484)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:164)
at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:401)
at com.gargoylesoftware.htmlunit.javascript.HtmlUnitContextFactory.doTopCall(HtmlUnitContextFactory.java:169)
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3004)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:162)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:465)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$6.doRun(JavaScriptEngine.java:430)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:522)
at org.mozilla.javascript.Context.call(Context.java:502)
at org.mozilla.javascript.ContextFactory.call(ContextFactory.java:511)
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:437)
at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptFunctionIfPossible(HtmlPage.java:916)
at com.gargoylesoftware.htmlunit.JavaScriptBackgroundJob.run(JavaScriptBackgroundJob.java:105)
at java.lang.Thread.run(Thread.java:595)
at com.gargoylesoftware.htmlunit.ThreadManager$1.run(ThreadManager.java:127)
======= EXCEPTION END ========
== CALLING JAVASCRIPT ==
function () {
b.call(a);
}
======= EXCEPTION END ========
.F
1)
'firefox submits with GMap query before' FAILED
expected true, got false
celerack_spec.rb:25:
2)
'ie submits with GMap query before' FAILED
expected true, got false
celerack_spec.rb:51:
3)
'resync_firefox submits with GMap query before' FAILED
expected true, got false
celerack_spec.rb:80:
4)
'resync_ie submits with GMap query before' FAILED
expected true, got false
celerack_spec.rb:107:
Finished in 17.967094 seconds
12 examples, 4 failures
</pre>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment