diff options
author | Diego Torres Milano <dtmilano@gmail.com> | 2012-01-28 18:55:09 -0500 |
---|---|---|
committer | Diego Torres Milano <dtmilano@gmail.com> | 2012-05-03 11:34:08 -0400 |
commit | 653ef98d1ee34717ab319b34cde577cd2c7d859e (patch) | |
tree | 66ea9b1e7e0f87d21010e99deb835e6e33aea886 /chimpchat/src | |
parent | a223f715737b30eba8b77bac583dd4686fb316aa (diff) | |
download | sdk-653ef98d1ee34717ab319b34cde577cd2c7d859e.zip sdk-653ef98d1ee34717ab319b34cde577cd2c7d859e.tar.gz sdk-653ef98d1ee34717ab319b34cde577cd2c7d859e.tar.bz2 |
Added check for mText property in getText()
Sometimes the node's property is not 'text:mText' but just 'mText'.
A new test was added to getText() to check for both properties and not
throwing unnecessarily the RuntimeException("No text property on node").
This has been tested by monkyrunner tests using EasyMonkeyDevice that runs
correctly after this patch is applied.
Change-Id: I5399169b906e28eeee0a17ab298a724cc5bb9b51
Signed-off-by: Diego Torres Milano <dtmilano@gmail.com>
Diffstat (limited to 'chimpchat/src')
-rw-r--r-- | chimpchat/src/com/android/chimpchat/hierarchyviewer/HierarchyViewer.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/chimpchat/src/com/android/chimpchat/hierarchyviewer/HierarchyViewer.java b/chimpchat/src/com/android/chimpchat/hierarchyviewer/HierarchyViewer.java index 6ad98ad..285d922 100644 --- a/chimpchat/src/com/android/chimpchat/hierarchyviewer/HierarchyViewer.java +++ b/chimpchat/src/com/android/chimpchat/hierarchyviewer/HierarchyViewer.java @@ -170,7 +170,11 @@ public class HierarchyViewer { } ViewNode.Property textProperty = node.namedProperties.get("text:mText"); if (textProperty == null) { - throw new RuntimeException("No text property on node"); + // give it another chance, ICS ViewServer returns mText + textProperty = node.namedProperties.get("mText"); + if (textProperty == null) { + throw new RuntimeException("No text property on node"); + } } return textProperty.value; } |