mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-10 03:45:46 +00:00
Bug 715197 - Robocop: implement isDisplayed(); r=jmaher
This commit is contained in:
parent
4aabbea5ec
commit
75fde9f5a2
@ -141,9 +141,29 @@ public class FennecNativeElement implements Element {
|
||||
return text.toString();
|
||||
}
|
||||
|
||||
private boolean displayed;
|
||||
|
||||
@Override
|
||||
public boolean isDisplayed() {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
final SynchronousQueue syncQueue = new SynchronousQueue();
|
||||
currentActivity = robocop.getCurrentActivity();
|
||||
displayed = false;
|
||||
currentActivity.runOnUiThread(
|
||||
new Runnable() {
|
||||
public void run() {
|
||||
View view = (View)currentActivity.findViewById(id);
|
||||
if(view != null) {
|
||||
displayed = true;
|
||||
}
|
||||
syncQueue.offer(new Object());
|
||||
}
|
||||
});
|
||||
try {
|
||||
syncQueue.take();
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return displayed;
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user