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 {
|
public class SectionsFlipperPlugin implements FlipperPlugin, ChangesetListener {
|
||||||
|
|
||||||
|
private final boolean mEnableDebugging;
|
||||||
private FlipperConnection mConnection;
|
private FlipperConnection mConnection;
|
||||||
|
|
||||||
|
public SectionsFlipperPlugin(boolean enableDebugging) {
|
||||||
|
mEnableDebugging = enableDebugging;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getId() {
|
public String getId() {
|
||||||
return "Sections";
|
return "Sections";
|
||||||
@@ -23,6 +28,10 @@ public class SectionsFlipperPlugin implements FlipperPlugin, ChangesetListener {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onConnect(FlipperConnection connection) throws Exception {
|
public void onConnect(FlipperConnection connection) throws Exception {
|
||||||
|
if (!mEnableDebugging) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
mConnection = connection;
|
mConnection = connection;
|
||||||
ChangesetDebug.setListener(this);
|
ChangesetDebug.setListener(this);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ import org.robolectric.RobolectricTestRunner;
|
|||||||
public class SectionsFlipperPluginTest {
|
public class SectionsFlipperPluginTest {
|
||||||
@Test
|
@Test
|
||||||
public void greetingTest() throws Exception {
|
public void greetingTest() throws Exception {
|
||||||
final SectionsFlipperPlugin plugin = new SectionsFlipperPlugin();
|
final SectionsFlipperPlugin plugin = new SectionsFlipperPlugin(true);
|
||||||
final FlipperConnectionMock connection = new FlipperConnectionMock();
|
final FlipperConnectionMock connection = new FlipperConnectionMock();
|
||||||
final FlipperResponderMock responder = new FlipperResponderMock();
|
final FlipperResponderMock responder = new FlipperResponderMock();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user