start(); synchronized (this) { try { wait(timeout); quit(); } catch (InterruptedException e) { } } if (!mDone) { throw new RuntimeException("test timed out"); } if (!mSuccess) { throw new RuntimeException("test failed"); }
mDone = true; mSuccess = false;
mLooper.quit();
Looper.prepare(); mLooper = Looper.myLooper(); go(); Looper.loop();
mDone = true; mSuccess = true;