For example, in the following extract of the same JS file, the
Selenium constructor appears well formatted, but the
decorateFunctionWithTimeout function is inlined.
Anyone knows the reason?
function Selenium(browserbot) {
this.browserbot = browserbot;
this.optionLocatorFactory = new OptionLocatorFactory;
this.page = function () {return browserbot;};
this.defaultTimeout = Selenium.DEFAULT_TIMEOUT;
this.mouseSpeed = Selenium.DEFAULT_MOUSE_SPEED;
if (bot && bot.locators && bot.locators.add) {
bot.locators.add("xpath", {single: function (target, opt_root) {return
browserbot.locateElementByXPath(target, opt_root);}, many: function
(target, opt_root) {return browserbot.locateElementsByXPath(target,
opt_root);}});
bot.locators.add("css", {single: function (target, opt_root) {return
browserbot.locateElementByCss(target, opt_root);}, many: function
(target, opt_root) {return eval_css(target, opt_root);}});
}
}
Selenium.DEFAULT_TIMEOUT = 30000;
Selenium.DEFAULT_MOUSE_SPEED = 10;
Selenium.RIGHT_MOUSE_CLICK = 2;
Selenium.decorateFunctionWithTimeout = function (f, timeout, callback)
{if (f == null) {return null;}var timeoutTime =
getTimeoutTime(timeout);return function () {if ((new Date).getTime() >
timeoutTime) {if (callback != null) {callback();}throw new
SeleniumError("Timed out aftmr " + timeout + "ms");}return f();};};