Create yoga performance plugin initial files using scarf
Summary: YogaPerformance flipper plugin initial files Auto generated using scarf plugin Reviewed By: davidaurelio Differential Revision: D15317118 fbshipit-source-id: 30c5c93a8ad4312478ea85979bdf230aa9186596
This commit is contained in:
committed by
Facebook Github Bot
parent
2badd4efea
commit
3086a7262d
@@ -0,0 +1,38 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2018-present, Facebook, Inc.
|
||||||
|
*
|
||||||
|
* This source code is licensed under the MIT license found in the LICENSE
|
||||||
|
* file in the root directory of this source tree.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
package com.facebook.flipper.plugins.yogaperformance;
|
||||||
|
|
||||||
|
import static org.hamcrest.CoreMatchers.hasItem;
|
||||||
|
import static org.hamcrest.MatcherAssert.assertThat;
|
||||||
|
|
||||||
|
import com.facebook.flipper.core.FlipperObject;
|
||||||
|
import com.facebook.flipper.testing.FlipperConnectionMock;
|
||||||
|
import com.facebook.flipper.testing.FlipperResponderMock;
|
||||||
|
import org.junit.Test;
|
||||||
|
import org.junit.runner.RunWith;
|
||||||
|
import org.robolectric.RobolectricTestRunner;
|
||||||
|
|
||||||
|
@RunWith(RobolectricTestRunner.class)
|
||||||
|
public class YogaPerformanceFlipperPluginTest {
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void greetingTest() throws Exception {
|
||||||
|
final YogaPerformanceFlipperPlugin plugin = new YogaPerformanceFlipperPlugin();
|
||||||
|
final FlipperConnectionMock connection = new FlipperConnectionMock();
|
||||||
|
final FlipperResponderMock responder = new FlipperResponderMock();
|
||||||
|
|
||||||
|
plugin.onConnect(connection);
|
||||||
|
connection.receivers.get("greet").onReceive(null, responder);
|
||||||
|
|
||||||
|
assertThat(
|
||||||
|
responder.successes, hasItem(new FlipperObject.Builder().put("greeting", "Hello").build()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* @scarf-info: used for tracking scarf generated files, do not remove */
|
||||||
|
/* @scarf-generated: flipper-plugin android/test/PluginTest.java 39408df4-f875-4b87-9d8a-21d310226532 */
|
||||||
Reference in New Issue
Block a user