Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(27)

Issue 2620803002: [chromedriver] Use nodeType instead of instanceof. (Closed)

Created:
3 years, 11 months ago by samuong
Modified:
3 years, 11 months ago
Reviewers:
stgao, PhistucK
CC:
chromium-reviews, samuong+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[chromedriver] Use nodeType instead of instanceof. For some reason, some pages redefine window.Element, which breaks our previous use of instanceof. BUG=chromedriver:1388 Review-Url: https://codereview.chromium.org/2620803002 Cr-Commit-Position: refs/heads/master@{#443405} Committed: https://chromium.googlesource.com/chromium/src/+/dea291aa30b95a0d81e2ac1d2661c1d93061c5a4

Patch Set 1 #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+9 lines, -1 line) Patch
M chrome/test/chromedriver/js/call_function.js View 1 chunk +2 lines, -1 line 2 comments Download
M chrome/test/chromedriver/test/run_py_tests.py View 1 chunk +7 lines, -0 lines 0 comments Download

Messages

Total messages: 12 (5 generated)
samuong
Some users have reported errors when finding elements, and after some investigation it turns out ...
3 years, 11 months ago (2017-01-12 20:25:50 UTC) #1
samuong
3 years, 11 months ago (2017-01-12 20:26:04 UTC) #3
stgao
Interesting use cases. LGTM
3 years, 11 months ago (2017-01-12 23:37:28 UTC) #4
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2620803002/1
3 years, 11 months ago (2017-01-12 23:53:00 UTC) #6
commit-bot: I haz the power
Committed patchset #1 (id:1) as https://chromium.googlesource.com/chromium/src/+/dea291aa30b95a0d81e2ac1d2661c1d93061c5a4
3 years, 11 months ago (2017-01-13 00:19:06 UTC) #9
PhistucK
https://codereview.chromium.org/2620803002/diff/1/chrome/test/chromedriver/js/call_function.js File chrome/test/chromedriver/js/call_function.js (right): https://codereview.chromium.org/2620803002/diff/1/chrome/test/chromedriver/js/call_function.js#newcode264 chrome/test/chromedriver/js/call_function.js:264: value.nodeType == Node.ELEMENT_NODE)) { For consistency, I think you ...
3 years, 11 months ago (2017-01-13 09:15:40 UTC) #11
samuong
3 years, 11 months ago (2017-01-13 18:26:42 UTC) #12
Message was sent while issue was closed.
https://codereview.chromium.org/2620803002/diff/1/chrome/test/chromedriver/js...
File chrome/test/chromedriver/js/call_function.js (right):

https://codereview.chromium.org/2620803002/diff/1/chrome/test/chromedriver/js...
chrome/test/chromedriver/js/call_function.js:264: value.nodeType ==
Node.ELEMENT_NODE)) {
On 2017/01/13 09:15:40, PhistucK wrote:
> For consistency, I think you should use the above defined NodeType.ELEMENT
(and
> below used).
> This has the benefit of not breaking in case Node is also redefined.

Sounds reasonable, I've created https://codereview.chromium.org/2629403003/ for
this. Thanks!

Powered by Google App Engine
This is Rietveld 408576698