Skip to content

Commit 2f4b652

Browse files
committed
Still breaking things on CI.
Revert "Revert "Revert "Update Closure library to head (5a4878ece3dd35230a21d745411ab0985cf99e15)""" This reverts commit 70083e8.
1 parent 4f8c792 commit 2f4b652

File tree

938 files changed

+48830
-61285
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

+48830
-61285
lines changed

javascript/remote/ui/client.js

Lines changed: 13 additions & 16 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');
2223
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.log.Logger} */
49-
this.log_ = goog.log.getLogger('remote.ui.Client');
48+
/** @private {!goog.debug.Logger} */
49+
this.log_ = goog.debug.Logger.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-
goog.log.error(this.log_, msg + '\n' + e);
185+
this.log_.severe(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-
goog.log.info(this.log_, 'Retrieving server status...');
198+
this.log_.info('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-
goog.log.info(this.log_, 'Refreshing sessions...');
220+
this.log_.info('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-
goog.log.info(this.log_, 'Creating new session for ' + e.data['browserName']);
243+
this.log_.info('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-
goog.log.warning(this.log_, 'Cannot delete session; no session selected!');
268+
this.log_.warning('Cannot delete session; no session selected!');
269269
return;
270270
}
271271

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

@@ -304,8 +303,7 @@ remote.ui.Client.prototype.onLoad_ = function(e) {
304303
var command = new webdriver.Command(webdriver.CommandName.GET).
305304
setParameter('sessionId', session.getId()).
306305
setParameter('url', url.toString());
307-
goog.log.info(this.log_,
308-
'In session(' + session.getId() + '), loading ' + url);
306+
this.log_.info('In session(' + session.getId() + '), loading ' + url);
309307
this.execute_(command).thenCatch(goog.bind(function(e) {
310308
this.logError_('Unable to load URL', e);
311309
}, this));
@@ -319,12 +317,11 @@ remote.ui.Client.prototype.onLoad_ = function(e) {
319317
remote.ui.Client.prototype.onScreenshot_ = function() {
320318
var session = this.sessionContainer_.getSelectedSession();
321319
if (!session) {
322-
goog.log.warning(this.log_,
323-
'Cannot take screenshot; no session selected!');
320+
this.log_.warning('Cannot take screenshot; no session selected!');
324321
return;
325322
}
326323

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

javascript/safari-driver/client.js

Lines changed: 9 additions & 10 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.log');
10+
goog.require('goog.debug.Logger');
1111
goog.require('safaridriver.message.Connect');
1212

1313

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

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

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

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');
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');
4241
var numAttempts = 0;
4342
var message = new safaridriver.message.Connect(url.toString());
4443
connect();
@@ -47,13 +46,13 @@ safaridriver.client.init = function() {
4746
numAttempts += 1;
4847
var acknowledged = message.sendSync(window);
4948
if (acknowledged) {
50-
goog.log.info(log, 'Connected to extension');
51-
goog.log.info(log, 'Requesting extension connect to client at ' + url);
49+
log.info('Connected to extension');
50+
log.info('Requesting extension connect to client at ' + url);
5251
} else if (numAttempts < 5) {
5352
var timeout = 250 * numAttempts;
5453
setTimeout(connect, timeout);
5554
} else {
56-
goog.log.error(log,
55+
log.severe(
5756
'Unable to establish a connection with the SafariDriver extension');
5857
}
5958
}

javascript/safari-driver/message/message.js

Lines changed: 5 additions & 4 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.log');
26+
goog.require('goog.debug.Logger');
2727
goog.require('safaridriver.dom');
2828

2929

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

4444

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

5152

5253
/**
@@ -110,7 +111,7 @@ safaridriver.message.fromEvent = function(event) {
110111
var type = data[safaridriver.message.Message.Field.TYPE];
111112
var factory = safaridriver.message.factoryRegistry_[type];
112113
if (!factory) {
113-
goog.log.fine(safaridriver.message.LOG_,
114+
safaridriver.message.LOG_.fine(
114115
'Unknown message type; falling back to the default factory: ' +
115116
bot.json.stringify(data));
116117
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-20140407.jar "
225+
"-c third_party/closure/bin/compiler-20130603.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-20140407.jar"
518+
pathelement :path => "third_party/closure/bin/compiler-20130603.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-20140407.jar"
687+
pathelement :path => "third_party/closure/bin/compiler-20130603.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-20140407.jar"
810+
pathelement :path => "third_party/closure/bin/compiler-20130603.jar"
811811
end
812812
arg :line => cmd
813813
end
6.49 MB
Binary file not shown.
-6.49 MB
Binary file not shown.

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

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

4443
/**
4544
* @type {goog.dom.DomHelper}
@@ -50,7 +49,7 @@ goog.a11y.aria.Announcer = function(opt_domHelper) {
5049
/**
5150
* Map of priority to live region elements to use for communicating updates.
5251
* Elements are created on demand.
53-
* @type {Object.<goog.a11y.aria.LivePriority, !Element>}
52+
* @type {Object.<goog.a11y.aria.LivePriority, Element>}
5453
* @private
5554
*/
5655
this.liveRegions_ = {};
@@ -64,7 +63,7 @@ goog.a11y.aria.Announcer.prototype.disposeInternal = function() {
6463
this.liveRegions_, this.domHelper_.removeNode, this.domHelper_);
6564
this.liveRegions_ = null;
6665
this.domHelper_ = null;
67-
goog.a11y.aria.Announcer.base(this, 'disposeInternal');
66+
goog.base(this, 'disposeInternal');
6867
};
6968

7069

@@ -84,16 +83,14 @@ goog.a11y.aria.Announcer.prototype.say = function(message, opt_priority) {
8483
/**
8584
* Returns an aria-live region that can be used to communicate announcements.
8685
* @param {!goog.a11y.aria.LivePriority} priority The required priority.
87-
* @return {!Element} A live region of the requested priority.
86+
* @return {Element} A live region of the requested priority.
8887
* @private
8988
*/
9089
goog.a11y.aria.Announcer.prototype.getLiveRegion_ = function(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;
90+
if (this.liveRegions_[priority]) {
91+
return this.liveRegions_[priority];
9692
}
93+
var liveRegion;
9794
liveRegion = this.domHelper_.createElement('div');
9895
// Note that IE has a habit of declaring things that aren't display:none as
9996
// 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: 34 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ 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');
3435

3536

3637
/**
@@ -103,7 +104,7 @@ goog.a11y.aria.setRole = function(element, roleName) {
103104
/**
104105
* Gets role of an element.
105106
* @param {!Element} element DOM element to get role of.
106-
* @return {!goog.a11y.aria.Role} ARIA Role name.
107+
* @return {?goog.a11y.aria.Role} ARIA Role name.
107108
*/
108109
goog.a11y.aria.getRole = function(element) {
109110
var role = element.getAttribute(goog.a11y.aria.ROLE_ATTRIBUTE_);
@@ -266,55 +267,38 @@ goog.a11y.aria.assertRoleIsSetInternalUtil = function(element, allowedRoles) {
266267

267268
/**
268269
* Gets the boolean value of an ARIA state/property.
270+
* Only to be used internally by the ARIA library in goog.a11y.aria.*.
269271
* @param {!Element} element The element to get the ARIA state for.
270272
* @param {!goog.a11y.aria.State|string} stateName the ARIA state name.
271273
* @return {?boolean} Boolean value for the ARIA state value or null if
272-
* the state value is not 'true', not 'false', or not set.
274+
* the state value is not 'true' or 'false'.
273275
*/
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;
276+
goog.a11y.aria.getBooleanStateInternalUtil = function(element, stateName) {
277+
var stringValue = goog.a11y.aria.getState(element, stateName);
278+
if (stringValue == 'true') {
279+
return true;
283280
}
284-
return goog.isBoolean(attr) ? attr : attr == 'true';
281+
if (stringValue == 'false') {
282+
return false;
283+
}
284+
return null;
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.*.
290291
* @param {!Element} element The element to get the ARIA state for.
291292
* @param {!goog.a11y.aria.State|string} stateName the ARIA state name.
292293
* @return {?number} Number value for the ARIA state value or null if
293-
* the state value is not a number or not set.
294-
*/
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.
294+
* the state value is not a number.
311295
*/
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;
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;
318302
};
319303

320304

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

336320

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+
337335
/**
338336
* Splits the input stringValue on whitespace.
339337
* @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)