Skip to content

Commit 70083e8

Browse files
committed
Revert "Revert "Update Closure library to head (5a4878ece3dd35230a21d745411ab0985cf99e15)""
This reverts commit d8a36a4. Originally reverted because the CI was not using Java 7. That has been fixed, so this should work now.
1 parent ec08311 commit 70083e8

File tree

938 files changed

+61280
-48825
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

938 files changed

+61280
-48825
lines changed

javascript/remote/ui/client.js

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ goog.require('goog.Disposable');
1919
goog.require('goog.Uri');
2020
goog.require('goog.array');
2121
goog.require('goog.debug.Console');
22-
goog.require('goog.debug.Logger');
2322
goog.require('goog.events');
23+
goog.require('goog.log');
2424
goog.require('remote.ui.Banner');
2525
goog.require('remote.ui.Event.Type');
2626
goog.require('remote.ui.ScreenshotDialog');
@@ -45,8 +45,8 @@ goog.require('webdriver.promise');
4545
remote.ui.Client = function(url, executor) {
4646
goog.base(this);
4747

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

5151
/** @private {!goog.debug.Console} */
5252
this.logConsole_ = new goog.debug.Console();
@@ -182,7 +182,7 @@ remote.ui.Client.prototype.execute_ = function(command) {
182182
* @private
183183
*/
184184
remote.ui.Client.prototype.logError_ = function(msg, e) {
185-
this.log_.severe(msg + '\n' + e);
185+
goog.log.error(this.log_, msg + '\n' + e);
186186
this.banner_.setMessage(msg);
187187
this.banner_.setVisible(true);
188188
};
@@ -195,7 +195,7 @@ remote.ui.Client.prototype.logError_ = function(msg, e) {
195195
* @private
196196
*/
197197
remote.ui.Client.prototype.updateServerInfo_ = function() {
198-
this.log_.info('Retrieving server status...');
198+
goog.log.info(this.log_, 'Retrieving server status...');
199199
return this.execute_(
200200
new webdriver.Command(webdriver.CommandName.GET_SERVER_STATUS)).
201201
then(goog.bind(function(response) {
@@ -217,7 +217,7 @@ remote.ui.Client.prototype.updateServerInfo_ = function() {
217217
* @private
218218
*/
219219
remote.ui.Client.prototype.onRefresh_ = function() {
220-
this.log_.info('Refreshing sessions...');
220+
goog.log.info(this.log_, 'Refreshing sessions...');
221221
var self = this;
222222
this.execute_(new webdriver.Command(webdriver.CommandName.GET_SESSIONS)).
223223
then(function(response) {
@@ -240,7 +240,7 @@ remote.ui.Client.prototype.onRefresh_ = function() {
240240
* @private
241241
*/
242242
remote.ui.Client.prototype.onCreate_ = function(e) {
243-
this.log_.info('Creating new session for ' + e.data['browserName']);
243+
goog.log.info(this.log_, 'Creating new session for ' + e.data['browserName']);
244244
var command = new webdriver.Command(webdriver.CommandName.NEW_SESSION).
245245
setParameter('desiredCapabilities', e.data);
246246
var self = this;
@@ -265,11 +265,11 @@ remote.ui.Client.prototype.onCreate_ = function(e) {
265265
remote.ui.Client.prototype.onDelete_ = function() {
266266
var session = this.sessionContainer_.getSelectedSession();
267267
if (!session) {
268-
this.log_.warning('Cannot delete session; no session selected!');
268+
goog.log.warning(this.log_, 'Cannot delete session; no session selected!');
269269
return;
270270
}
271271

272-
this.log_.info('Deleting session: ' + session.getId());
272+
goog.log.info(this.log_, 'Deleting session: ' + session.getId());
273273
var command = new webdriver.Command(webdriver.CommandName.QUIT).
274274
setParameter('sessionId', session.getId());
275275
var self = this;
@@ -292,7 +292,8 @@ remote.ui.Client.prototype.onDelete_ = function() {
292292
remote.ui.Client.prototype.onLoad_ = function(e) {
293293
var session = this.sessionContainer_.getSelectedSession();
294294
if (!session) {
295-
this.log_.warning('Cannot load url: ' + e.data + '; no session selected!');
295+
goog.log.warning(this.log_,
296+
'Cannot load url: ' + e.data + '; no session selected!');
296297
return;
297298
}
298299

@@ -303,7 +304,8 @@ remote.ui.Client.prototype.onLoad_ = function(e) {
303304
var command = new webdriver.Command(webdriver.CommandName.GET).
304305
setParameter('sessionId', session.getId()).
305306
setParameter('url', url.toString());
306-
this.log_.info('In session(' + session.getId() + '), loading ' + url);
307+
goog.log.info(this.log_,
308+
'In session(' + session.getId() + '), loading ' + url);
307309
this.execute_(command).thenCatch(goog.bind(function(e) {
308310
this.logError_('Unable to load URL', e);
309311
}, this));
@@ -317,11 +319,12 @@ remote.ui.Client.prototype.onLoad_ = function(e) {
317319
remote.ui.Client.prototype.onScreenshot_ = function() {
318320
var session = this.sessionContainer_.getSelectedSession();
319321
if (!session) {
320-
this.log_.warning('Cannot take screenshot; no session selected!');
322+
goog.log.warning(this.log_,
323+
'Cannot take screenshot; no session selected!');
321324
return;
322325
}
323326

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

javascript/safari-driver/client.js

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ goog.provide('safaridriver.client');
77

88
goog.require('goog.Uri');
99
goog.require('goog.debug.DivConsole');
10-
goog.require('goog.debug.Logger');
10+
goog.require('goog.log');
1111
goog.require('safaridriver.message.Connect');
1212

1313

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

28-
var log = goog.debug.Logger.getLogger('safaridriver.client');
28+
var log = goog.log.getLogger('safaridriver.client');
2929

3030
var url = new goog.Uri(window.location).getQueryData().get('url');
3131
if (!url) {
32-
log.severe(
32+
goog.log.error(log,
3333
'No url specified. Please reload this page with the url parameter set');
3434
return;
3535
}
3636
url = new goog.Uri(url);
3737

38-
log.info('Connecting to SafariDriver browser extension...');
39-
log.info('Extension logs may be viewed by clicking the Selenium [\u2713] ' +
40-
'button on the Safari toolbar');
38+
goog.log.info(log, 'Connecting to SafariDriver browser extension...');
39+
goog.log.info(log,
40+
'Extension logs may be viewed by clicking the Selenium [\u2713] ' +
41+
'button on the Safari toolbar');
4142
var numAttempts = 0;
4243
var message = new safaridriver.message.Connect(url.toString());
4344
connect();
@@ -46,13 +47,13 @@ safaridriver.client.init = function() {
4647
numAttempts += 1;
4748
var acknowledged = message.sendSync(window);
4849
if (acknowledged) {
49-
log.info('Connected to extension');
50-
log.info('Requesting extension connect to client at ' + url);
50+
goog.log.info(log, 'Connected to extension');
51+
goog.log.info(log, 'Requesting extension connect to client at ' + url);
5152
} else if (numAttempts < 5) {
5253
var timeout = 250 * numAttempts;
5354
setTimeout(connect, timeout);
5455
} else {
55-
log.severe(
56+
goog.log.error(log,
5657
'Unable to establish a connection with the SafariDriver extension');
5758
}
5859
}

javascript/safari-driver/message/message.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ goog.provide('safaridriver.message.Message');
2323

2424
goog.require('bot.json');
2525
goog.require('goog.asserts');
26-
goog.require('goog.debug.Logger');
26+
goog.require('goog.log');
2727
goog.require('safaridriver.dom');
2828

2929

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

4444

4545
/**
46-
* @private {!goog.debug.Logger}
46+
* @private {goog.log.Logger}
4747
* @const
4848
*/
49-
safaridriver.message.LOG_ = goog.debug.Logger.getLogger(
50-
'safaridriver.message');
49+
safaridriver.message.LOG_ = goog.log.getLogger('safaridriver.message');
5150

5251

5352
/**
@@ -111,7 +110,7 @@ safaridriver.message.fromEvent = function(event) {
111110
var type = data[safaridriver.message.Message.Field.TYPE];
112111
var factory = safaridriver.message.factoryRegistry_[type];
113112
if (!factory) {
114-
safaridriver.message.LOG_.fine(
113+
goog.log.fine(safaridriver.message.LOG_,
115114
'Unknown message type; falling back to the default factory: ' +
116115
bot.json.stringify(data));
117116
factory = safaridriver.message.Message.fromData_;

rake-tasks/crazy_fun/mappings/javascript.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ def initialize()
222222
py = "python"
223223
end
224224
@calcdeps = "#{py} third_party/closure/bin/calcdeps.py " +
225-
"-c third_party/closure/bin/compiler-20130603.jar "
225+
"-c third_party/closure/bin/compiler-20140407.jar "
226226
end
227227

228228
def js_name(dir, name)
@@ -515,7 +515,7 @@ def handle(fun, dir, args)
515515

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

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

808808
CrazyFunJava.ant.java :classname => "com.google.javascript.jscomp.CommandLineRunner", :fork => false, :failonerror => true do
809809
classpath do
810-
pathelement :path => "third_party/closure/bin/compiler-20130603.jar"
810+
pathelement :path => "third_party/closure/bin/compiler-20140407.jar"
811811
end
812812
arg :line => cmd
813813
end
6.04 MB
Binary file not shown.
6.49 MB
Binary file not shown.

third_party/closure/goog/a11y/aria/announcer.js

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,10 @@ goog.require('goog.object');
3636
* @param {goog.dom.DomHelper=} opt_domHelper DOM helper.
3737
* @constructor
3838
* @extends {goog.Disposable}
39+
* @final
3940
*/
4041
goog.a11y.aria.Announcer = function(opt_domHelper) {
41-
goog.base(this);
42+
goog.a11y.aria.Announcer.base(this, 'constructor');
4243

4344
/**
4445
* @type {goog.dom.DomHelper}
@@ -49,7 +50,7 @@ goog.a11y.aria.Announcer = function(opt_domHelper) {
4950
/**
5051
* Map of priority to live region elements to use for communicating updates.
5152
* Elements are created on demand.
52-
* @type {Object.<goog.a11y.aria.LivePriority, Element>}
53+
* @type {Object.<goog.a11y.aria.LivePriority, !Element>}
5354
* @private
5455
*/
5556
this.liveRegions_ = {};
@@ -63,7 +64,7 @@ goog.a11y.aria.Announcer.prototype.disposeInternal = function() {
6364
this.liveRegions_, this.domHelper_.removeNode, this.domHelper_);
6465
this.liveRegions_ = null;
6566
this.domHelper_ = null;
66-
goog.base(this, 'disposeInternal');
67+
goog.a11y.aria.Announcer.base(this, 'disposeInternal');
6768
};
6869

6970

@@ -83,14 +84,16 @@ goog.a11y.aria.Announcer.prototype.say = function(message, opt_priority) {
8384
/**
8485
* Returns an aria-live region that can be used to communicate announcements.
8586
* @param {!goog.a11y.aria.LivePriority} priority The required priority.
86-
* @return {Element} A live region of the requested priority.
87+
* @return {!Element} A live region of the requested priority.
8788
* @private
8889
*/
8990
goog.a11y.aria.Announcer.prototype.getLiveRegion_ = function(priority) {
90-
if (this.liveRegions_[priority]) {
91-
return this.liveRegions_[priority];
91+
var liveRegion = this.liveRegions_[priority];
92+
if (liveRegion) {
93+
// Make sure the live region is not aria-hidden.
94+
goog.a11y.aria.removeState(liveRegion, goog.a11y.aria.State.HIDDEN);
95+
return liveRegion;
9296
}
93-
var liveRegion;
9497
liveRegion = this.domHelper_.createElement('div');
9598
// Note that IE has a habit of declaring things that aren't display:none as
9699
// invisible to third-party tools like JAWs, so we can't just use height:0.

third_party/closure/goog/a11y/aria/aria.js

Lines changed: 36 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ goog.require('goog.asserts');
3131
goog.require('goog.dom');
3232
goog.require('goog.dom.TagName');
3333
goog.require('goog.object');
34-
goog.require('goog.string');
3534

3635

3736
/**
@@ -104,7 +103,7 @@ goog.a11y.aria.setRole = function(element, roleName) {
104103
/**
105104
* Gets role of an element.
106105
* @param {!Element} element DOM element to get role of.
107-
* @return {?goog.a11y.aria.Role} ARIA Role name.
106+
* @return {!goog.a11y.aria.Role} ARIA Role name.
108107
*/
109108
goog.a11y.aria.getRole = function(element) {
110109
var role = element.getAttribute(goog.a11y.aria.ROLE_ATTRIBUTE_);
@@ -267,38 +266,55 @@ goog.a11y.aria.assertRoleIsSetInternalUtil = function(element, allowedRoles) {
267266

268267
/**
269268
* Gets the boolean value of an ARIA state/property.
270-
* Only to be used internally by the ARIA library in goog.a11y.aria.*.
271269
* @param {!Element} element The element to get the ARIA state for.
272270
* @param {!goog.a11y.aria.State|string} stateName the ARIA state name.
273271
* @return {?boolean} Boolean value for the ARIA state value or null if
274-
* the state value is not 'true' or 'false'.
272+
* the state value is not 'true', not 'false', or not set.
275273
*/
276-
goog.a11y.aria.getBooleanStateInternalUtil = function(element, stateName) {
277-
var stringValue = goog.a11y.aria.getState(element, stateName);
278-
if (stringValue == 'true') {
279-
return true;
280-
}
281-
if (stringValue == 'false') {
282-
return false;
274+
goog.a11y.aria.getStateBoolean = function(element, stateName) {
275+
var attr =
276+
/** @type {string|boolean} */ (element.getAttribute(
277+
goog.a11y.aria.getAriaAttributeName_(stateName)));
278+
goog.asserts.assert(
279+
goog.isBoolean(attr) || attr == null || attr == 'true' ||
280+
attr == 'false');
281+
if (attr == null) {
282+
return attr;
283283
}
284-
return null;
284+
return goog.isBoolean(attr) ? attr : attr == 'true';
285285
};
286286

287287

288288
/**
289289
* Gets the number value of an ARIA state/property.
290-
* Only to be used internally by the ARIA library in goog.a11y.aria.*.
291290
* @param {!Element} element The element to get the ARIA state for.
292291
* @param {!goog.a11y.aria.State|string} stateName the ARIA state name.
293292
* @return {?number} Number value for the ARIA state value or null if
294-
* the state value is not a number.
293+
* the state value is not a number or not set.
295294
*/
296-
goog.a11y.aria.getNumberStateInternalUtil = function(element, stateName) {
297-
var stringValue = goog.a11y.aria.getState(element, stateName);
298-
if (goog.string.isNumeric(stringValue)) {
299-
return goog.string.toNumber(stringValue);
300-
}
301-
return null;
295+
goog.a11y.aria.getStateNumber = function(element, stateName) {
296+
var attr =
297+
/** @type {string|number} */ (element.getAttribute(
298+
goog.a11y.aria.getAriaAttributeName_(stateName)));
299+
goog.asserts.assert((attr == null || !isNaN(Number(attr))) &&
300+
!goog.isBoolean(attr));
301+
return attr == null ? null : Number(attr);
302+
};
303+
304+
305+
/**
306+
* Gets the string value of an ARIA state/property.
307+
* @param {!Element} element The element to get the ARIA state for.
308+
* @param {!goog.a11y.aria.State|string} stateName the ARIA state name.
309+
* @return {?string} String value for the ARIA state value or null if
310+
* the state value is empty string or not set.
311+
*/
312+
goog.a11y.aria.getStateString = function(element, stateName) {
313+
var attr = element.getAttribute(
314+
goog.a11y.aria.getAriaAttributeName_(stateName));
315+
goog.asserts.assert((attr == null || goog.isString(attr)) &&
316+
isNaN(Number(attr)) && attr != 'true' && attr != 'false');
317+
return attr == null ? null : attr;
302318
};
303319

304320

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

320336

321-
/**
322-
* Gets the string value of an ARIA state/property.
323-
* Only to be used internally by the ARIA library in goog.a11y.aria.*.
324-
* @param {!Element} element The element to get the ARIA state for.
325-
* @param {!goog.a11y.aria.State|string} stateName the ARIA state name.
326-
* @return {?string} String value for the ARIA state value or null if
327-
* the state value is empty string.
328-
*/
329-
goog.a11y.aria.getStringStateInternalUtil = function(element, stateName) {
330-
var stringValue = goog.a11y.aria.getState(element, stateName);
331-
return stringValue || null;
332-
};
333-
334-
335337
/**
336338
* Splits the input stringValue on whitespace.
337339
* @param {string} stringValue The value of the string to split.

third_party/closure/goog/a11y/aria/datatables.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ goog.a11y.aria.DefaultStateValueMap_;
4040
* A method that creates a map that contains mapping between an ARIA state and
4141
* the default value for it. Note that not all ARIA states have default values.
4242
*
43-
* @return {Object.<!(goog.a11y.aria.State|string), (string|boolean|number)>}
43+
* @return {!Object.<!(goog.a11y.aria.State|string), (string|boolean|number)>}
4444
* The names for each of the notification methods.
4545
*/
4646
goog.a11y.aria.datatables.getDefaultValuesMap = function() {

0 commit comments

Comments
 (0)