Skip to content

Commit 7703db2

Browse files
committed
Workarounds for js tests in Chrome.
And a random missing semicolon!
1 parent 4c889b9 commit 7703db2

File tree

3 files changed

+29
-16
lines changed

3 files changed

+29
-16
lines changed

Diff for: javascript/atoms/test/scrolling_test.html

+6-4
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,10 @@
4545
goog.userAgent.product.ANDROID ||
4646
goog.labs.userAgent.browser.isChrome() &&
4747
goog.labs.userAgent.platform.isAndroid() &&
48-
goog.labs.userAgent.browser.isVersionOrHigher('40'),
48+
goog.labs.userAgent.browser.isVersionOrHigher('40') &&
49+
!goog.labs.userAgent.browser.isVersionOrHigher('41'),
4950
'Android doesn\'t currently provide scrolling information. ' +
50-
'Chrome for Android regressed in m40, apparently: ' +
51+
'Chrome for Android regressed in m40, but was fixed in m41: ' +
5152
'https://code.google.com/p/chromium/issues/detail?id=448404');
5253
expectedFailures.run(function() {
5354
assertNotEquals(0, getTopLevelParent().scrollLeft);
@@ -164,9 +165,10 @@
164165
goog.userAgent.product.ANDROID ||
165166
goog.labs.userAgent.browser.isChrome() &&
166167
goog.labs.userAgent.platform.isAndroid() &&
167-
goog.labs.userAgent.browser.isVersionOrHigher('40'),
168+
goog.labs.userAgent.browser.isVersionOrHigher('40') &&
169+
!goog.labs.userAgent.browser.isVersionOrHigher('41'),
168170
'Android doesn\'t currently provide scrolling information. ' +
169-
'Chrome for Android regressed in m40, apparently: ' +
171+
'Chrome for Android regressed in m40, but was fixed in m41: ' +
170172
'https://code.google.com/p/chromium/issues/detail?id=448404');
171173
expectedFailures.run(function() {
172174
assertNotEquals(0, getTopLevelParent().scrollLeft);

Diff for: javascript/atoms/test/select_test.html

+22-11
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,11 @@
276276

277277
action(radioButtons[0]);
278278

279-
assertChanges(0);
279+
// Chromium 44 seems to have a regression here:
280+
// https://code.google.com/p/chromium/issues/detail?id=500084
281+
if (!goog.userAgent.product.CHROME || !bot.userAgent.isProductVersion(44)) {
282+
assertChanges(0);
283+
}
280284
assertTrue(bot.dom.isSelected(radioButtons[0]));
281285
}
282286

@@ -361,10 +365,17 @@
361365

362366
action(elem);
363367

364-
// WebKit and IE9 standards mode fire change events when the
368+
// WebKit (except Chromium 44+) and IE9 standards mode fire change events when the
365369
// checkbox isn't toggled.
366-
assertChanges(
367-
goog.userAgent.WEBKIT || bot.userAgent.IE_DOC_9 ? 1 : 0);
370+
// TODO: Check if Chromium behavior changes after this issue is resolved:
371+
// https://code.google.com/p/chromium/issues/detail?id=500084
372+
if (bot.userAgent.IE_DOC_9 ||
373+
(goog.userAgent.WEBKIT &&
374+
!(goog.userAgent.product.CHROME && bot.userAgent.isProductVersion(44)))) {
375+
assertChanges(1);
376+
} else {
377+
assertChanges(0);
378+
}
368379
assertFalse(bot.dom.isSelected(elem));
369380
}
370381

@@ -387,16 +398,16 @@
387398

388399
action(elem);
389400

390-
// Chrome < 39 and WebKit select a radio button even when the handler
391-
// prevents the default; IE does not.
392-
if ((goog.userAgent.product.CHROME &&
393-
!bot.userAgent.isProductVersion(39)) ||
394-
(goog.userAgent.WEBKIT && !goog.userAgent.product.CHROME)) {
401+
// WebKit selects a radio button even when the handler prevents the default; others do not.
402+
if (goog.userAgent.WEBKIT && !goog.userAgent.product.CHROME) {
395403
assertChanges(1);
396404
assertTrue(bot.dom.isSelected(elem));
397405
} else {
398-
// IE9 standards mode and Chrome still fire the change event.
399-
if (bot.userAgent.IE_DOC_9 || goog.userAgent.product.CHROME) {
406+
// IE9 standards mode, Chromium 43 and earlier versions still fire the change event.
407+
// TODO: Check if Chromium behavior changes after this issue is resolved:
408+
// https://code.google.com/p/chromium/issues/detail?id=500084
409+
if (bot.userAgent.IE_DOC_9 ||
410+
goog.userAgent.product.CHROME && !bot.userAgent.isProductVersion(44)) {
400411
assertChanges(1);
401412
} else {
402413
assertChanges(0);

Diff for: javascript/node/selenium-webdriver/test/window_test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ test.suite(function(env) {
103103
driver.manage().window().getSize().then(function(size) {
104104
driver.manage().window().setSize(size.width + dx, size.height + dy);
105105
driver.wait(forSizeToBe(size.width + dx, size.height + dy), 1000);
106-
})
106+
});
107107
}
108108

109109
function forSizeToBe(w, h) {

0 commit comments

Comments
 (0)