|
7 | 7 | goog.require('bot.action');
|
8 | 8 | goog.require('bot.dom');
|
9 | 9 | goog.require('goog.dom');
|
| 10 | + goog.require('goog.labs.userAgent.browser'); |
| 11 | + goog.require('goog.labs.userAgent.device'); |
| 12 | + goog.require('goog.labs.userAgent.platform'); |
10 | 13 | goog.require('goog.math.Coordinate');
|
11 | 14 | goog.require('goog.testing.ExpectedFailures');
|
12 | 15 | goog.require('goog.testing.jsunit');
|
|
38 | 41 | function testScrollsElementInToViewIfRequired() {
|
39 | 42 | bot.action.scrollIntoView(findElement({id: 'offscreen'}));
|
40 | 43 |
|
41 |
| - expectedFailures.expectFailureFor(goog.userAgent.product.ANDROID, |
42 |
| - 'Android doesn\'t currently provide scrolling information'); |
| 44 | + expectedFailures.expectFailureFor( |
| 45 | + goog.userAgent.product.ANDROID || |
| 46 | + goog.labs.userAgent.browser.isChrome() && |
| 47 | + goog.labs.userAgent.platform.isAndroid() && |
| 48 | + goog.labs.userAgent.browser.isVersionOrHigher('40'), |
| 49 | + 'Android doesn\'t currently provide scrolling information. ' + |
| 50 | + 'Chrome for Android regressed in m40, apparently: ' + |
| 51 | + 'https://code.google.com/p/chromium/issues/detail?id=448404'); |
43 | 52 | expectedFailures.run(function() {
|
44 | 53 | assertNotEquals(0, getTopLevelParent().scrollLeft);
|
45 | 54 | });
|
|
151 | 160 |
|
152 | 161 | bot.action.scrollIntoView(element);
|
153 | 162 |
|
| 163 | + expectedFailures.expectFailureFor( |
| 164 | + goog.userAgent.product.ANDROID || |
| 165 | + goog.labs.userAgent.browser.isChrome() && |
| 166 | + goog.labs.userAgent.platform.isAndroid() && |
| 167 | + goog.labs.userAgent.browser.isVersionOrHigher('40'), |
| 168 | + 'Android doesn\'t currently provide scrolling information. ' + |
| 169 | + 'Chrome for Android regressed in m40, apparently: ' + |
| 170 | + 'https://code.google.com/p/chromium/issues/detail?id=448404'); |
| 171 | + expectedFailures.run(function() { |
| 172 | + assertNotEquals(0, getTopLevelParent().scrollLeft); |
| 173 | + }); |
154 | 174 | expectedFailures.expectFailureFor(goog.userAgent.product.ANDROID,
|
155 | 175 | 'Android doesn\'t currently provide scrolling information');
|
156 | 176 | expectedFailures.run(function() {
|
157 |
| - assertNotEquals(0, getTopLevelParent().scrollLeft); |
158 | 177 | assertNotEquals(0, frameDocument.body.scrollLeft);
|
159 | 178 | assertNotEquals(0, top.scrollLeft);
|
160 | 179 | assertNotEquals(0, middle.scrollLeft);
|
|
190 | 209 |
|
191 | 210 | // If the scrollbar isn't taken into account, the minimum scrolling
|
192 | 211 | // needed would be 26 pixels, to bring the full pixel into view.
|
193 |
| - // This should fail on mobile since the scrollbars aren't shown. |
| 212 | + // This should fail on mobile and tablet since the scrollbars aren't shown. |
194 | 213 | // This should also fail on IE6 since scrolling only happens to
|
195 | 214 | // exactly the scrollbar width, which is 17 by default on Windows XP.
|
196 | 215 | expectedFailures.expectFailureFor(
|
197 |
| - goog.userAgent.MOBILE || |
| 216 | + goog.labs.userAgent.device.isMobile() || goog.labs.userAgent.device.isTablet() || |
198 | 217 | (goog.userAgent.IE && !goog.userAgent.isVersion(7)));
|
199 | 218 | expectedFailures.run(function() {
|
200 | 219 | assertTrue('horizontal scroll did not account for scrollbar',
|
|
205 | 224 | }
|
206 | 225 | </script>
|
207 | 226 | <div style="position: absolute; left: 150px; top: 100px; border: 2px yellow solid;"><a id="onscreen">Onscreen</a></div>
|
208 |
| - <div style="position: absolute; left: 3000px; border: 2px orange solid;"><a id="offscreen">Offscreen</a></div> |
| 227 | + <div style="position: absolute; left: 8000px; border: 2px orange solid;"><a id="offscreen">Offscreen</a></div> |
209 | 228 | <div style="overflow: hidden; width: 50px; height: 30px; border: 2px blue solid;" id="hidden-by-overflow-container">
|
210 | 229 | <a style="margin-left: 100px;" id="hidden-by-overflow">Hidden</a></div>
|
211 | 230 | </div>
|
|
235 | 254 | </div>
|
236 | 255 |
|
237 | 256 | <iframe src="testdata/scrolling_iframe.html" style="width: 200px; height: 100px;" id="scrollable-iframe"></iframe>
|
238 |
| - <div style="position: absolute; left: 3000px; top: 200px; border: 2px orange solid;"> |
| 257 | + <div style="position: absolute; left: 8000px; top: 200px; border: 2px orange solid;"> |
239 | 258 | <iframe src="testdata/scrolling_iframe.html" style="width: 200px; height: 100px;" id="offscreen-scrollable-iframe"></iframe>
|
240 | 259 | </div>
|
241 | 260 |
|
|
0 commit comments