Add Flipper plugin to Litho's sample apps
Summary: Add plugin to sample app. Reviewed By: marco-cova Differential Revision: D16181876 fbshipit-source-id: fe60fa9f593c16cb24d6901c98b6392a05c6d837
This commit is contained in:
committed by
Facebook Github Bot
parent
aff991b313
commit
9c96545bbd
@@ -14,8 +14,13 @@ import com.facebook.flipper.plugins.sections.ChangesetDebug.ChangesetListener;
|
||||
|
||||
public class SectionsFlipperPlugin implements FlipperPlugin, ChangesetListener {
|
||||
|
||||
private final boolean mEnableDebugging;
|
||||
private FlipperConnection mConnection;
|
||||
|
||||
public SectionsFlipperPlugin(boolean enableDebugging) {
|
||||
mEnableDebugging = enableDebugging;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getId() {
|
||||
return "Sections";
|
||||
@@ -23,6 +28,10 @@ public class SectionsFlipperPlugin implements FlipperPlugin, ChangesetListener {
|
||||
|
||||
@Override
|
||||
public void onConnect(FlipperConnection connection) throws Exception {
|
||||
if (!mEnableDebugging) {
|
||||
return;
|
||||
}
|
||||
|
||||
mConnection = connection;
|
||||
ChangesetDebug.setListener(this);
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ import org.robolectric.RobolectricTestRunner;
|
||||
public class SectionsFlipperPluginTest {
|
||||
@Test
|
||||
public void greetingTest() throws Exception {
|
||||
final SectionsFlipperPlugin plugin = new SectionsFlipperPlugin();
|
||||
final SectionsFlipperPlugin plugin = new SectionsFlipperPlugin(true);
|
||||
final FlipperConnectionMock connection = new FlipperConnectionMock();
|
||||
final FlipperResponderMock responder = new FlipperResponderMock();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user