Commit b72ff88c authored by WangHui's avatar WangHui Committed by Chromium LUCI CQ

android: Fix String compared to CharSequence failed.

No logic changed.

Bug:None

Change-Id: Ib73cd10d6f7cffef67367f6da7ce26aefe0b2758
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2631515
Commit-Queue: HuiWang <wanghui210@huawei.com>
Reviewed-by: default avatarAbigail Klein <abigailbklein@google.com>
Cr-Commit-Position: refs/heads/master@{#844338}
parent 6c1dbfe2
...@@ -196,7 +196,10 @@ public class WebContentsAccessibilityTest { ...@@ -196,7 +196,10 @@ public class WebContentsAccessibilityTest {
return waitForNodeMatching(provider, new AccessibilityNodeInfoMatcher() { return waitForNodeMatching(provider, new AccessibilityNodeInfoMatcher() {
@Override @Override
public boolean matches(AccessibilityNodeInfo node) { public boolean matches(AccessibilityNodeInfo node) {
return text.equals(node.getText()) && node.isVisibleToUser(); if (node.getText() == null) {
return false;
}
return text.equals(node.getText().toString()) && node.isVisibleToUser();
} }
}); });
} }
...@@ -210,7 +213,11 @@ public class WebContentsAccessibilityTest { ...@@ -210,7 +213,11 @@ public class WebContentsAccessibilityTest {
return waitForNodeMatching(provider, new AccessibilityNodeInfoMatcher() { return waitForNodeMatching(provider, new AccessibilityNodeInfoMatcher() {
@Override @Override
public boolean matches(AccessibilityNodeInfo node) { public boolean matches(AccessibilityNodeInfo node) {
return text.equals(node.getText()) || text.equals(node.getContentDescription()); if (node.getText() == null) {
return text.equals(node.getContentDescription());
}
return text.equals(node.getText().toString())
|| text.equals(node.getContentDescription());
} }
}); });
} }
...@@ -223,7 +230,10 @@ public class WebContentsAccessibilityTest { ...@@ -223,7 +230,10 @@ public class WebContentsAccessibilityTest {
return waitForNodeMatching(provider, new AccessibilityNodeInfoMatcher() { return waitForNodeMatching(provider, new AccessibilityNodeInfoMatcher() {
@Override @Override
public boolean matches(AccessibilityNodeInfo node) { public boolean matches(AccessibilityNodeInfo node) {
return text.equals(node.getText()); if (node.getText() == null) {
return false;
}
return text.equals(node.getText().toString());
} }
}); });
} }
......
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