|
@@ -12,9 +12,10 @@ import java.util.concurrent.atomic.AtomicBoolean;
|
12
|
12
|
class ReactIdlingResource implements IdlingResource, NotThreadSafeBridgeIdleDebugListener {
|
13
|
13
|
private final NavigationActivity activity;
|
14
|
14
|
private ResourceCallback callback;
|
|
15
|
+ private AtomicBoolean registered = new AtomicBoolean(false);
|
|
16
|
+ private AtomicBoolean bridgeIdle = new AtomicBoolean(false);
|
15
|
17
|
|
16
|
18
|
ReactIdlingResource(NavigationActivity activity) {
|
17
|
|
- android.util.Log.d("DebuggingIsHell", "------------------------------");
|
18
|
19
|
this.activity = activity;
|
19
|
20
|
NavigationApplication.instance.runOnUiThreadDelayed(new Runnable() {
|
20
|
21
|
@Override
|
|
@@ -26,8 +27,6 @@ class ReactIdlingResource implements IdlingResource, NotThreadSafeBridgeIdleDebu
|
26
|
27
|
}, 10);
|
27
|
28
|
}
|
28
|
29
|
|
29
|
|
- private AtomicBoolean registered = new AtomicBoolean(false);
|
30
|
|
- private AtomicBoolean bridgeIdle = new AtomicBoolean(false);
|
31
|
30
|
|
32
|
31
|
@Override
|
33
|
32
|
public String getName() {
|
|
@@ -49,7 +48,6 @@ class ReactIdlingResource implements IdlingResource, NotThreadSafeBridgeIdleDebu
|
49
|
48
|
}
|
50
|
49
|
|
51
|
50
|
boolean idle = bridgeIdle.get();
|
52
|
|
- android.util.Log.d("DebuggingIsHell", "idle " + idle);
|
53
|
51
|
if (idle) {
|
54
|
52
|
callback.onTransitionToIdle();
|
55
|
53
|
}
|
|
@@ -63,13 +61,11 @@ class ReactIdlingResource implements IdlingResource, NotThreadSafeBridgeIdleDebu
|
63
|
61
|
|
64
|
62
|
@Override
|
65
|
63
|
public void onTransitionToBridgeIdle() {
|
66
|
|
- android.util.Log.d("DebuggingIsHell", "IDLE");
|
67
|
64
|
bridgeIdle.set(true);
|
68
|
65
|
}
|
69
|
66
|
|
70
|
67
|
@Override
|
71
|
68
|
public void onTransitionToBridgeBusy() {
|
72
|
|
- android.util.Log.d("DebuggingIsHell", "busy");
|
73
|
69
|
bridgeIdle.set(false);
|
74
|
70
|
}
|
75
|
71
|
}
|