Convert LooperExecutorTest in AppRTC Demo into JUnit test

LooperExecutorTest now uses Robolectric instead of being instrumentation
test. This allows the test to be run faster and easier.

Review-Url: https://codereview.webrtc.org/1989813002
Cr-Commit-Position: refs/heads/master@{#12825}
This commit is contained in:
sakal
2016-05-20 03:56:49 -07:00
committed by Commit bot
parent 2d285ca150
commit f8312cb45a
3 changed files with 129 additions and 70 deletions

View File

@ -72,7 +72,7 @@ public class LooperExecutor extends Thread implements Executor {
handler.post(new Runnable() {
@Override
public void run() {
Looper.myLooper().quit();
handler.getLooper().quit();
Log.d(TAG, "Looper thread finished.");
}
});
@ -131,4 +131,10 @@ public class LooperExecutor extends Thread implements Executor {
}
}
/**
* Access to the handler for testing purposes.
*/
Handler getHandler() {
return handler;
}
}