commit | fc778ec243c6efd3f402672f432717bc287c9dfb | [log] [tgz] |
---|---|---|
author | Darren Shen <shend@chromium.org> | Mon Jan 07 21:45:18 2019 |
committer | Commit Bot <commit-bot@chromium.org> | Mon Jan 07 21:45:18 2019 |
tree | dcfefbb03cef570853ba9f22951fd8bf81245afa | |
parent | ca1fdde6ca24e9506c6dfbde1419d093cf51c3d8 [diff] |
[automation] Add null check in AutomationNode.getNodeFromTree. We wrote some automated UI tests using the Chrome automation framework, but encountered some errors happening inside the JavaScript code for AutomationNode: https://crbug.com/893957#c24 The error is: TypeError: Method called without a valid receiver (this). Did you forget to call .bind()?" After codesearching, this error seems to occur when we pass an invalid object to the "privates" function [1]. From the JavaScript stack trace, it looks like this is the line in AutomationNode.getNodeFromTree that raises the error: privates(AutomationRootNodeImpl.get(treeId)).impl which suggests AutomationRootNodeImpl.get(treeId) was null. I'm not familiar enough with this code to figure out the root cause, so I'll just add an additional null check to prevent this error from happening again. [1] https://cs.chromium.org/chromium/src/extensions/renderer/module_system.cc?type=cs&sq=package:chromium&g=0&l=666 Bug: 893957 Change-Id: I3d4d6edb6d22eabf85a9b5b4399c1a75cf16956b Reviewed-on: https://chromium-review.googlesource.com/c/1393683 Reviewed-by: David Tseng <dtseng@chromium.org> Commit-Queue: Darren Shen <shend@chromium.org> Cr-Commit-Position: refs/heads/master@{#620486}
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.
The project's web site is https://www.chromium.org.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure .