commit | 87e3c67a1d613767ec90b3a948da86c16b9643cd | [log] [tgz] |
---|---|---|
author | Yuheng Huang <[email protected]> | Sat Oct 30 00:53:50 2021 |
committer | Chromium LUCI CQ <[email protected]> | Sat Oct 30 00:53:50 2021 |
tree | 805387fd7926f644a9e4e7298b0cd2fbb9cfaa8b | |
parent | 63057727da87b472194d08547cad840a12eecd74 [diff] [blame] |
UIDevtool: Support query by ID This change is mainly used for supporting Desktop UI benchmark to query element by id. Previously we used class name to find elements, which is not ideal as discussed in the doc. We will gradually migrate to query element by id since it's more robust to code refactor. Doc: https://docs.google.com/document/d/1zcVPqvatmAyNZQZOT_yL8Goj1xckt0eUfAGEGEoOf9g/edit?usp=sharing&resourcekey=0-RJywpBq5u1XqweomTY-NWA Bug: 1201243 Change-Id: I95488d622381fe56b64c316d07fc8dfa4843a54f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3253505 Commit-Queue: Yuheng Huang <[email protected]> Reviewed-by: Wei Li <[email protected]> Cr-Commit-Position: refs/heads/main@{#936628}
diff --git a/components/ui_devtools/ui_element.h b/components/ui_devtools/ui_element.h index 9a081f7..3ec8046 100644 --- a/components/ui_devtools/ui_element.h +++ b/components/ui_devtools/ui_element.h
@@ -140,6 +140,11 @@ // Get the sources for the element. std::vector<Source> GetSources(); + // Get the ID of the backing UI element. This is used to locate + // a UIElement by ID set on the browser side and different than + // node_id(). + virtual int GetBackingElementID(); + virtual bool DispatchMouseEvent(protocol::DOM::MouseEvent* event); virtual bool DispatchKeyEvent(protocol::DOM::KeyEvent* event);