Commit 89412f63 authored by John Chen's avatar John Chen Committed by Commit Bot

[ChromeDriver] Fix testChromeDriverSendLargeData on Android

testChromeDriverSendLargeData used to use string concatenation to
generate a long string, which was slow and can timeout on slow devices.
Improving efficiency by using String.repeat() instead, to make it fast
enough for Android.

Bug: chromedriver:1175
Change-Id: I9b030a43c82cdbe69c374718a307a66f57cf04a3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1763171Reviewed-by: default avatarRohan Pavone <rohpavone@chromium.org>
Commit-Queue: John Chen <johnchen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#689063}
parent 0c67f256
......@@ -197,8 +197,6 @@ _ANDROID_NEGATIVE_FILTER['chrome'] = (
'SessionHandlingTest.testGetSessions',
# Android doesn't use the chrome://print dialog.
'ChromeDriverTest.testCanSwitchToPrintPreviewDialog',
# https://bugs.chromium.org/p/chromedriver/issues/detail?id=1175
'ChromeDriverTest.testChromeDriverSendLargeData',
# Chrome 44+ for Android doesn't dispatch the dblclick event
'ChromeDriverTest.testMouseDoubleClick',
# Page cannot be loaded from file:// URI in Android unless it
......@@ -1382,7 +1380,7 @@ class ChromeDriverTest(ChromeDriverBaseTestWithWebServer):
self._driver.ExecuteScript('debugger;')
def testChromeDriverSendLargeData(self):
script = 'var s = ""; for (var i = 0; i < 10e6; i++) s += "0"; return s;'
script = 'return "0".repeat(10e6);'
lots_of_data = self._driver.ExecuteScript(script)
self.assertEquals('0'.zfill(int(10e6)), lots_of_data)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment