Commit d163f259 authored by kkania@chromium.org's avatar kkania@chromium.org

Update WebDriver atoms to r17589 to pick up r17582.

This fixes the find elements command when used on pages with prototype JS lib.
BUG=chromedriver:102
TEST=none

Review URL: https://chromiumcodereview.appspot.com/10829048

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@148795 0039d316-1c4b-4281-b951-d872f2087c98
parent be581ff5
<html>
<script>
// JavaScript built-in types aren't enumerable.
var arrayFuncs = [
'concat',
'every',
'filter',
'forEach',
'indexOf',
'join',
'lastIndexOf',
'length',
'map',
'pop',
'push',
'reduce',
'reduceRight',
'reverse',
'shift',
'slice',
'some',
'sort',
'splice',
'unshift'];
for (var prop in arrayFuncs) {
Array.prototype[prop] = function() {
throw new Error('Array.prototype.' + prop + ' should not be called');
}
}
JSON.stringify = function() {
throw new Error('JSON.stringify should not be called');
}
JSON.parse = function() {
throw new Error('JSON.parse should not be called');
}
</script>
<body>
<div>
Tests that no native functions are called by ChromeDriver.
</div>
</body>
</html>
......@@ -1146,3 +1146,12 @@ class ExtensionTest(ChromeDriverTest):
WebDriverWait(driver, 10).until(is_page_action_visible)
ext.click_page_action()
self._testExtensionView(driver, ext.get_popup_handle(), ext)
class BadJSTest(ChromeDriverTest):
"""Tests that ensure sites with hacky JS don't break ChromeDriver."""
def testFindElementDoesNotUseNativeFuncs(self):
driver = self.GetNewDriver()
driver.get(self.GetTestDataUrl() + '/bad_native_funcs.html')
# This will throw an exception if any native funcs are used.
driver.find_element_by_tag_name('body').find_elements_by_tag_name('div')
......@@ -20,7 +20,7 @@ Contents:
atoms.h, atoms.cc
These atoms are generated by the webdriver team and are to be checked in
manually. The current version was generated from revision 17181.
manually. The current version was generated from revision 17589.
To generate the atoms using the code found in selenium tree:
$ svn checkout http://selenium.googlecode.com/svn/trunk/ selenium-read-only
......
This diff is collapsed.
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