Skip to content

Commit

Permalink
Revert "Revert "Update Closure library to head (5a4878ece3dd35230a21d…
Browse files Browse the repository at this point in the history
…745411ab0985cf99e15)""

This reverts commit d8a36a4.

Originally reverted because the CI was not using Java 7. That has been fixed,
so this should work now.
  • Loading branch information
jleyba committed May 14, 2014
1 parent ec08311 commit 70083e8
Show file tree
Hide file tree
Showing 938 changed files with 61,280 additions and 48,825 deletions.
29 changes: 16 additions & 13 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.debug.Logger} */
this.log_ = goog.debug.Logger.getLogger('remote.ui.Client');
/** @private {goog.log.Logger} */
this.log_ = goog.log.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) {
this.log_.severe(msg + '\n' + e);
goog.log.error(this.log_, 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() {
this.log_.info('Retrieving server status...');
goog.log.info(this.log_, '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() {
this.log_.info('Refreshing sessions...');
goog.log.info(this.log_, '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) {
this.log_.info('Creating new session for ' + e.data['browserName']);
goog.log.info(this.log_, '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) {
this.log_.warning('Cannot delete session; no session selected!');
goog.log.warning(this.log_, 'Cannot delete session; no session selected!');
return;
}

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

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

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

Expand Down
19 changes: 10 additions & 9 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.debug.Logger');
goog.require('goog.log');
goog.require('safaridriver.message.Connect');


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

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

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

log.info('Connecting to SafariDriver browser extension...');
log.info('Extension logs may be viewed by clicking the Selenium [\u2713] ' +
'button on the Safari toolbar');
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');
var numAttempts = 0;
var message = new safaridriver.message.Connect(url.toString());
connect();
Expand All @@ -46,13 +47,13 @@ safaridriver.client.init = function() {
numAttempts += 1;
var acknowledged = message.sendSync(window);
if (acknowledged) {
log.info('Connected to extension');
log.info('Requesting extension connect to client at ' + url);
goog.log.info(log, 'Connected to extension');
goog.log.info(log, 'Requesting extension connect to client at ' + url);
} else if (numAttempts < 5) {
var timeout = 250 * numAttempts;
setTimeout(connect, timeout);
} else {
log.severe(
goog.log.error(log,
'Unable to establish a connection with the SafariDriver extension');
}
}
Expand Down
9 changes: 4 additions & 5 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.debug.Logger');
goog.require('goog.log');
goog.require('safaridriver.dom');


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


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


/**
Expand Down Expand Up @@ -111,7 +110,7 @@ safaridriver.message.fromEvent = function(event) {
var type = data[safaridriver.message.Message.Field.TYPE];
var factory = safaridriver.message.factoryRegistry_[type];
if (!factory) {
safaridriver.message.LOG_.fine(
goog.log.fine(safaridriver.message.LOG_,
'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-20130603.jar "
"-c third_party/closure/bin/compiler-20140407.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-20130603.jar"
pathelement :path => "third_party/closure/bin/compiler-20140407.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-20130603.jar"
pathelement :path => "third_party/closure/bin/compiler-20140407.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-20130603.jar"
pathelement :path => "third_party/closure/bin/compiler-20140407.jar"
end
arg :line => cmd
end
Expand Down
Binary file not shown.
Binary file added third_party/closure/bin/compiler.jar
Binary file not shown.
17 changes: 10 additions & 7 deletions third_party/closure/goog/a11y/aria/announcer.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,10 @@ 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.base(this);
goog.a11y.aria.Announcer.base(this, 'constructor');

/**
* @type {goog.dom.DomHelper}
Expand All @@ -49,7 +50,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 @@ -63,7 +64,7 @@ goog.a11y.aria.Announcer.prototype.disposeInternal = function() {
this.liveRegions_, this.domHelper_.removeNode, this.domHelper_);
this.liveRegions_ = null;
this.domHelper_ = null;
goog.base(this, 'disposeInternal');
goog.a11y.aria.Announcer.base(this, 'disposeInternal');
};


Expand All @@ -83,14 +84,16 @@ 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) {
if (this.liveRegions_[priority]) {
return this.liveRegions_[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;
}
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: 36 additions & 34 deletions third_party/closure/goog/a11y/aria/aria.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ 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 @@ -104,7 +103,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 @@ -267,38 +266,55 @@ 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' or 'false'.
* the state value is not 'true', not 'false', or not set.
*/
goog.a11y.aria.getBooleanStateInternalUtil = function(element, stateName) {
var stringValue = goog.a11y.aria.getState(element, stateName);
if (stringValue == 'true') {
return true;
}
if (stringValue == 'false') {
return 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;
}
return null;
return goog.isBoolean(attr) ? attr : attr == 'true';
};


/**
* 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.
* the state value is not a number or not set.
*/
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;
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.
*/
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;
};


Expand All @@ -318,20 +334,6 @@ 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 70083e8

Please sign in to comment.