Skip to content

Commit

Permalink
Revert "Update Closure library to head (5a4878ece3dd35230a21d745411ab…
Browse files Browse the repository at this point in the history
…0985cf99e15)"

This reverts commit 10d8abe.

Compiler update requires Java 7, which is not on CI
Library update requires compiler update
  • Loading branch information
jleyba committed May 12, 2014
1 parent 10d8abe commit d8a36a4
Show file tree
Hide file tree
Showing 938 changed files with 48,830 additions and 61,285 deletions.
29 changes: 13 additions & 16 deletions javascript/remote/ui/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ goog.require('goog.Disposable');
goog.require('goog.Uri');
goog.require('goog.array');
goog.require('goog.debug.Console');
goog.require('goog.debug.Logger');
goog.require('goog.events');
goog.require('goog.log');
goog.require('remote.ui.Banner');
goog.require('remote.ui.Event.Type');
goog.require('remote.ui.ScreenshotDialog');
Expand All @@ -45,8 +45,8 @@ goog.require('webdriver.promise');
remote.ui.Client = function(url, executor) {
goog.base(this);

/** @private {goog.log.Logger} */
this.log_ = goog.log.getLogger('remote.ui.Client');
/** @private {!goog.debug.Logger} */
this.log_ = goog.debug.Logger.getLogger('remote.ui.Client');

/** @private {!goog.debug.Console} */
this.logConsole_ = new goog.debug.Console();
Expand Down Expand Up @@ -182,7 +182,7 @@ remote.ui.Client.prototype.execute_ = function(command) {
* @private
*/
remote.ui.Client.prototype.logError_ = function(msg, e) {
goog.log.error(this.log_, msg + '\n' + e);
this.log_.severe(msg + '\n' + e);
this.banner_.setMessage(msg);
this.banner_.setVisible(true);
};
Expand All @@ -195,7 +195,7 @@ remote.ui.Client.prototype.logError_ = function(msg, e) {
* @private
*/
remote.ui.Client.prototype.updateServerInfo_ = function() {
goog.log.info(this.log_, 'Retrieving server status...');
this.log_.info('Retrieving server status...');
return this.execute_(
new webdriver.Command(webdriver.CommandName.GET_SERVER_STATUS)).
then(goog.bind(function(response) {
Expand All @@ -217,7 +217,7 @@ remote.ui.Client.prototype.updateServerInfo_ = function() {
* @private
*/
remote.ui.Client.prototype.onRefresh_ = function() {
goog.log.info(this.log_, 'Refreshing sessions...');
this.log_.info('Refreshing sessions...');
var self = this;
this.execute_(new webdriver.Command(webdriver.CommandName.GET_SESSIONS)).
then(function(response) {
Expand All @@ -240,7 +240,7 @@ remote.ui.Client.prototype.onRefresh_ = function() {
* @private
*/
remote.ui.Client.prototype.onCreate_ = function(e) {
goog.log.info(this.log_, 'Creating new session for ' + e.data['browserName']);
this.log_.info('Creating new session for ' + e.data['browserName']);
var command = new webdriver.Command(webdriver.CommandName.NEW_SESSION).
setParameter('desiredCapabilities', e.data);
var self = this;
Expand All @@ -265,11 +265,11 @@ remote.ui.Client.prototype.onCreate_ = function(e) {
remote.ui.Client.prototype.onDelete_ = function() {
var session = this.sessionContainer_.getSelectedSession();
if (!session) {
goog.log.warning(this.log_, 'Cannot delete session; no session selected!');
this.log_.warning('Cannot delete session; no session selected!');
return;
}

goog.log.info(this.log_, 'Deleting session: ' + session.getId());
this.log_.info('Deleting session: ' + session.getId());
var command = new webdriver.Command(webdriver.CommandName.QUIT).
setParameter('sessionId', session.getId());
var self = this;
Expand All @@ -292,8 +292,7 @@ remote.ui.Client.prototype.onDelete_ = function() {
remote.ui.Client.prototype.onLoad_ = function(e) {
var session = this.sessionContainer_.getSelectedSession();
if (!session) {
goog.log.warning(this.log_,
'Cannot load url: ' + e.data + '; no session selected!');
this.log_.warning('Cannot load url: ' + e.data + '; no session selected!');
return;
}

Expand All @@ -304,8 +303,7 @@ remote.ui.Client.prototype.onLoad_ = function(e) {
var command = new webdriver.Command(webdriver.CommandName.GET).
setParameter('sessionId', session.getId()).
setParameter('url', url.toString());
goog.log.info(this.log_,
'In session(' + session.getId() + '), loading ' + url);
this.log_.info('In session(' + session.getId() + '), loading ' + url);
this.execute_(command).thenCatch(goog.bind(function(e) {
this.logError_('Unable to load URL', e);
}, this));
Expand All @@ -319,12 +317,11 @@ remote.ui.Client.prototype.onLoad_ = function(e) {
remote.ui.Client.prototype.onScreenshot_ = function() {
var session = this.sessionContainer_.getSelectedSession();
if (!session) {
goog.log.warning(this.log_,
'Cannot take screenshot; no session selected!');
this.log_.warning('Cannot take screenshot; no session selected!');
return;
}

goog.log.info(this.log_, 'Taking screenshot: ' + session.getId());
this.log_.info('Taking screenshot: ' + session.getId());
var command = new webdriver.Command(webdriver.CommandName.SCREENSHOT).
setParameter('sessionId', session.getId());

Expand Down
19 changes: 9 additions & 10 deletions javascript/safari-driver/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ goog.provide('safaridriver.client');

goog.require('goog.Uri');
goog.require('goog.debug.DivConsole');
goog.require('goog.log');
goog.require('goog.debug.Logger');
goog.require('safaridriver.message.Connect');


Expand All @@ -25,20 +25,19 @@ safaridriver.client.init = function() {
var divConsole = new goog.debug.DivConsole(div);
divConsole.setCapturing(true);

var log = goog.log.getLogger('safaridriver.client');
var log = goog.debug.Logger.getLogger('safaridriver.client');

var url = new goog.Uri(window.location).getQueryData().get('url');
if (!url) {
goog.log.error(log,
log.severe(
'No url specified. Please reload this page with the url parameter set');
return;
}
url = new goog.Uri(url);

goog.log.info(log, 'Connecting to SafariDriver browser extension...');
goog.log.info(log,
'Extension logs may be viewed by clicking the Selenium [\u2713] ' +
'button on the Safari toolbar');
log.info('Connecting to SafariDriver browser extension...');
log.info('Extension logs may be viewed by clicking the Selenium [\u2713] ' +
'button on the Safari toolbar');
var numAttempts = 0;
var message = new safaridriver.message.Connect(url.toString());
connect();
Expand All @@ -47,13 +46,13 @@ safaridriver.client.init = function() {
numAttempts += 1;
var acknowledged = message.sendSync(window);
if (acknowledged) {
goog.log.info(log, 'Connected to extension');
goog.log.info(log, 'Requesting extension connect to client at ' + url);
log.info('Connected to extension');
log.info('Requesting extension connect to client at ' + url);
} else if (numAttempts < 5) {
var timeout = 250 * numAttempts;
setTimeout(connect, timeout);
} else {
goog.log.error(log,
log.severe(
'Unable to establish a connection with the SafariDriver extension');
}
}
Expand Down
9 changes: 5 additions & 4 deletions javascript/safari-driver/message/message.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ goog.provide('safaridriver.message.Message');

goog.require('bot.json');
goog.require('goog.asserts');
goog.require('goog.log');
goog.require('goog.debug.Logger');
goog.require('safaridriver.dom');


Expand All @@ -43,10 +43,11 @@ safaridriver.message.ORIGIN = 'webdriver';


/**
* @private {goog.log.Logger}
* @private {!goog.debug.Logger}
* @const
*/
safaridriver.message.LOG_ = goog.log.getLogger('safaridriver.message');
safaridriver.message.LOG_ = goog.debug.Logger.getLogger(
'safaridriver.message');


/**
Expand Down Expand Up @@ -110,7 +111,7 @@ safaridriver.message.fromEvent = function(event) {
var type = data[safaridriver.message.Message.Field.TYPE];
var factory = safaridriver.message.factoryRegistry_[type];
if (!factory) {
goog.log.fine(safaridriver.message.LOG_,
safaridriver.message.LOG_.fine(
'Unknown message type; falling back to the default factory: ' +
bot.json.stringify(data));
factory = safaridriver.message.Message.fromData_;
Expand Down
8 changes: 4 additions & 4 deletions rake-tasks/crazy_fun/mappings/javascript.rb
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ def initialize()
py = "python"
end
@calcdeps = "#{py} third_party/closure/bin/calcdeps.py " +
"-c third_party/closure/bin/compiler-20140407.jar "
"-c third_party/closure/bin/compiler-20130603.jar "
end

def js_name(dir, name)
Expand Down Expand Up @@ -515,7 +515,7 @@ def handle(fun, dir, args)

CrazyFunJava.ant.java :classname => "com.google.javascript.jscomp.CommandLineRunner", :failonerror => true do
classpath do
pathelement :path => "third_party/closure/bin/compiler-20140407.jar"
pathelement :path => "third_party/closure/bin/compiler-20130603.jar"
end
arg :line => cmd
end
Expand Down Expand Up @@ -684,7 +684,7 @@ def handle(fun, dir, args)

CrazyFunJava.ant.java :classname => "com.google.javascript.jscomp.CommandLineRunner", :failonerror => true do
classpath do
pathelement :path => "third_party/closure/bin/compiler-20140407.jar"
pathelement :path => "third_party/closure/bin/compiler-20130603.jar"
end
arg :line => flags.join(" ")
end
Expand Down Expand Up @@ -807,7 +807,7 @@ def handle(fun, dir, args)

CrazyFunJava.ant.java :classname => "com.google.javascript.jscomp.CommandLineRunner", :fork => false, :failonerror => true do
classpath do
pathelement :path => "third_party/closure/bin/compiler-20140407.jar"
pathelement :path => "third_party/closure/bin/compiler-20130603.jar"
end
arg :line => cmd
end
Expand Down
Binary file not shown.
Binary file removed third_party/closure/bin/compiler.jar
Binary file not shown.
17 changes: 7 additions & 10 deletions third_party/closure/goog/a11y/aria/announcer.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,9 @@ goog.require('goog.object');
* @param {goog.dom.DomHelper=} opt_domHelper DOM helper.
* @constructor
* @extends {goog.Disposable}
* @final
*/
goog.a11y.aria.Announcer = function(opt_domHelper) {
goog.a11y.aria.Announcer.base(this, 'constructor');
goog.base(this);

/**
* @type {goog.dom.DomHelper}
Expand All @@ -50,7 +49,7 @@ goog.a11y.aria.Announcer = function(opt_domHelper) {
/**
* Map of priority to live region elements to use for communicating updates.
* Elements are created on demand.
* @type {Object.<goog.a11y.aria.LivePriority, !Element>}
* @type {Object.<goog.a11y.aria.LivePriority, Element>}
* @private
*/
this.liveRegions_ = {};
Expand All @@ -64,7 +63,7 @@ goog.a11y.aria.Announcer.prototype.disposeInternal = function() {
this.liveRegions_, this.domHelper_.removeNode, this.domHelper_);
this.liveRegions_ = null;
this.domHelper_ = null;
goog.a11y.aria.Announcer.base(this, 'disposeInternal');
goog.base(this, 'disposeInternal');
};


Expand All @@ -84,16 +83,14 @@ goog.a11y.aria.Announcer.prototype.say = function(message, opt_priority) {
/**
* Returns an aria-live region that can be used to communicate announcements.
* @param {!goog.a11y.aria.LivePriority} priority The required priority.
* @return {!Element} A live region of the requested priority.
* @return {Element} A live region of the requested priority.
* @private
*/
goog.a11y.aria.Announcer.prototype.getLiveRegion_ = function(priority) {
var liveRegion = this.liveRegions_[priority];
if (liveRegion) {
// Make sure the live region is not aria-hidden.
goog.a11y.aria.removeState(liveRegion, goog.a11y.aria.State.HIDDEN);
return liveRegion;
if (this.liveRegions_[priority]) {
return this.liveRegions_[priority];
}
var liveRegion;
liveRegion = this.domHelper_.createElement('div');
// Note that IE has a habit of declaring things that aren't display:none as
// invisible to third-party tools like JAWs, so we can't just use height:0.
Expand Down
70 changes: 34 additions & 36 deletions third_party/closure/goog/a11y/aria/aria.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ goog.require('goog.asserts');
goog.require('goog.dom');
goog.require('goog.dom.TagName');
goog.require('goog.object');
goog.require('goog.string');


/**
Expand Down Expand Up @@ -103,7 +104,7 @@ goog.a11y.aria.setRole = function(element, roleName) {
/**
* Gets role of an element.
* @param {!Element} element DOM element to get role of.
* @return {!goog.a11y.aria.Role} ARIA Role name.
* @return {?goog.a11y.aria.Role} ARIA Role name.
*/
goog.a11y.aria.getRole = function(element) {
var role = element.getAttribute(goog.a11y.aria.ROLE_ATTRIBUTE_);
Expand Down Expand Up @@ -266,55 +267,38 @@ goog.a11y.aria.assertRoleIsSetInternalUtil = function(element, allowedRoles) {

/**
* Gets the boolean value of an ARIA state/property.
* Only to be used internally by the ARIA library in goog.a11y.aria.*.
* @param {!Element} element The element to get the ARIA state for.
* @param {!goog.a11y.aria.State|string} stateName the ARIA state name.
* @return {?boolean} Boolean value for the ARIA state value or null if
* the state value is not 'true', not 'false', or not set.
* the state value is not 'true' or 'false'.
*/
goog.a11y.aria.getStateBoolean = function(element, stateName) {
var attr =
/** @type {string|boolean} */ (element.getAttribute(
goog.a11y.aria.getAriaAttributeName_(stateName)));
goog.asserts.assert(
goog.isBoolean(attr) || attr == null || attr == 'true' ||
attr == 'false');
if (attr == null) {
return attr;
goog.a11y.aria.getBooleanStateInternalUtil = function(element, stateName) {
var stringValue = goog.a11y.aria.getState(element, stateName);
if (stringValue == 'true') {
return true;
}
return goog.isBoolean(attr) ? attr : attr == 'true';
if (stringValue == 'false') {
return false;
}
return null;
};


/**
* Gets the number value of an ARIA state/property.
* Only to be used internally by the ARIA library in goog.a11y.aria.*.
* @param {!Element} element The element to get the ARIA state for.
* @param {!goog.a11y.aria.State|string} stateName the ARIA state name.
* @return {?number} Number value for the ARIA state value or null if
* the state value is not a number or not set.
*/
goog.a11y.aria.getStateNumber = function(element, stateName) {
var attr =
/** @type {string|number} */ (element.getAttribute(
goog.a11y.aria.getAriaAttributeName_(stateName)));
goog.asserts.assert((attr == null || !isNaN(Number(attr))) &&
!goog.isBoolean(attr));
return attr == null ? null : Number(attr);
};


/**
* Gets the string value of an ARIA state/property.
* @param {!Element} element The element to get the ARIA state for.
* @param {!goog.a11y.aria.State|string} stateName the ARIA state name.
* @return {?string} String value for the ARIA state value or null if
* the state value is empty string or not set.
* the state value is not a number.
*/
goog.a11y.aria.getStateString = function(element, stateName) {
var attr = element.getAttribute(
goog.a11y.aria.getAriaAttributeName_(stateName));
goog.asserts.assert((attr == null || goog.isString(attr)) &&
isNaN(Number(attr)) && attr != 'true' && attr != 'false');
return attr == null ? null : attr;
goog.a11y.aria.getNumberStateInternalUtil = function(element, stateName) {
var stringValue = goog.a11y.aria.getState(element, stateName);
if (goog.string.isNumeric(stringValue)) {
return goog.string.toNumber(stringValue);
}
return null;
};


Expand All @@ -334,6 +318,20 @@ goog.a11y.aria.getStringArrayStateInternalUtil = function(element, stateName) {
};


/**
* Gets the string value of an ARIA state/property.
* Only to be used internally by the ARIA library in goog.a11y.aria.*.
* @param {!Element} element The element to get the ARIA state for.
* @param {!goog.a11y.aria.State|string} stateName the ARIA state name.
* @return {?string} String value for the ARIA state value or null if
* the state value is empty string.
*/
goog.a11y.aria.getStringStateInternalUtil = function(element, stateName) {
var stringValue = goog.a11y.aria.getState(element, stateName);
return stringValue || null;
};


/**
* Splits the input stringValue on whitespace.
* @param {string} stringValue The value of the string to split.
Expand Down
2 changes: 1 addition & 1 deletion third_party/closure/goog/a11y/aria/datatables.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ goog.a11y.aria.DefaultStateValueMap_;
* A method that creates a map that contains mapping between an ARIA state and
* the default value for it. Note that not all ARIA states have default values.
*
* @return {!Object.<!(goog.a11y.aria.State|string), (string|boolean|number)>}
* @return {Object.<!(goog.a11y.aria.State|string), (string|boolean|number)>}
* The names for each of the notification methods.
*/
goog.a11y.aria.datatables.getDefaultValuesMap = function() {
Expand Down
Loading

0 comments on commit d8a36a4

Please sign in to comment.