Java Code Examples for org.robolectric.Shadows#shadowOf()

The following examples show how to use org.robolectric.Shadows#shadowOf() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: IntentsTest.java    From droidconat-2016 with Apache License 2.0 6 votes vote down vote up
@Test
public void should_start_external_uri() {
    // Given
    String url = "http://www.google.com";
    RobolectricPackageManager rpm = (RobolectricPackageManager) RuntimeEnvironment.application.getPackageManager();
    rpm.addResolveInfoForIntent(new Intent(Intent.ACTION_VIEW, Uri.parse(url)), ShadowResolveInfo.newResolveInfo("", "", ""));

    // When
    Intents.startExternalUrl(activity, url);

    // Then
    ShadowActivity shadowActivity = Shadows.shadowOf(activity);
    Intent startedIntent = shadowActivity.getNextStartedActivity();

    assertThat(startedIntent.getAction()).isEqualTo(Intent.ACTION_VIEW);
    assertThat(startedIntent.getData().toString()).isEqualTo(url);
}
 
Example 2
Source File: TestActivityTest.java    From Awesome-WanAndroid with Apache License 2.0 6 votes vote down vote up
@Test
public void showToast() {
    Toast latestToast = ShadowToast.getLatestToast();
    Assert.assertNull(latestToast);

    Button button = (Button) mTestActivity.findViewById(R.id.button2);
    button.performClick();

    latestToast = ShadowToast.getLatestToast();
    Assert.assertNotNull(latestToast);

    ShadowToast shadowToast = Shadows.shadowOf(latestToast);
    ShadowLog.d("toast_time", shadowToast.getDuration() + "");
    Assert.assertEquals(Toast.LENGTH_SHORT, shadowToast.getDuration());
    Assert.assertEquals("hahaha", ShadowToast.getTextOfLatestToast());
}
 
Example 3
Source File: TestActivityTest.java    From Awesome-WanAndroid with Apache License 2.0 6 votes vote down vote up
@Test
public void showDialog() {
    AlertDialog latestAlertDialog = ShadowAlertDialog.getLatestAlertDialog();
    Assert.assertNull(latestAlertDialog);

    Button button = (Button) mTestActivity.findViewById(R.id.button3);
    button.performClick();

    latestAlertDialog = ShadowAlertDialog.getLatestAlertDialog();
    Assert.assertNotNull(latestAlertDialog);

    ShadowAlertDialog shadowAlertDialog = Shadows.shadowOf(latestAlertDialog);
    Assert.assertEquals("Dialog", shadowAlertDialog.getTitle());
    ShadowLog.d("dialog_tag", (String) shadowAlertDialog.getMessage());
    Assert.assertEquals("showDialog", shadowAlertDialog.getMessage());
}
 
Example 4
Source File: RobolectricUtils.java    From android-browser-helper with Apache License 2.0 6 votes vote down vote up
/**
 * Ensures intents with {@link CustomTabsService#ACTION_CUSTOM_TABS_CONNECTION} resolve to a
 * Service with given categories
 */
public static void installCustomTabsService(String providerPackage, List<String> categories) {
    Intent intent = new Intent()
            .setAction(CustomTabsService.ACTION_CUSTOM_TABS_CONNECTION)
            .setPackage(providerPackage);

    IntentFilter filter = new IntentFilter();
    for (String category : categories) {
        filter.addCategory(category);
    }
    ResolveInfo resolveInfo = new ResolveInfo();
    resolveInfo.filter = filter;

    ShadowPackageManager manager = Shadows.shadowOf(RuntimeEnvironment.application
            .getPackageManager());
    manager.addResolveInfoForIntent(intent, resolveInfo);
}
 
Example 5
Source File: WXWebViewTest.java    From ucar-weex-core with Apache License 2.0 5 votes vote down vote up
@Before
public void setUp() throws Exception {
  Activity activity = Robolectric.setupActivity(TestActivity.class);
  view = new WXWebView(activity);
  webView = (WebView)((ViewGroup)view.getView()).getChildAt(0);//first child
  shadow = Shadows.shadowOf(webView);
}
 
Example 6
Source File: ComponentTreeHasCompatibleLayoutTest.java    From litho with Apache License 2.0 5 votes vote down vote up
@Before
public void setup() throws Exception {
  mContext = new ComponentContext(getApplicationContext());
  mComponent = SimpleMountSpecTester.create(mContext).build();
  mComponentTree = create(mContext, mComponent).build();

  mLayoutThreadShadowLooper =
      Shadows.shadowOf(
          (Looper) Whitebox.invokeMethod(ComponentTree.class, "getDefaultLayoutThreadLooper"));

  mWidthSpec = makeSizeSpec(39, EXACTLY);
  mWidthSpec2 = makeSizeSpec(40, EXACTLY);
  mHeightSpec = makeSizeSpec(41, EXACTLY);
  mHeightSpec2 = makeSizeSpec(42, EXACTLY);
}
 
Example 7
Source File: LayoutStateFutureReleaseTest.java    From litho with Apache License 2.0 5 votes vote down vote up
@Before
public void setup() {
  mContext = new ComponentContext(getApplicationContext(), null, null, null, null);
  ComponentsConfiguration.useCancelableLayoutFutures = true;

  mWidthSpec = makeSizeSpec(40, EXACTLY);
  mHeightSpec = makeSizeSpec(40, EXACTLY);

  mLayoutThreadShadowLooper =
      Shadows.shadowOf(
          (Looper) Whitebox.invokeMethod(ComponentTree.class, "getDefaultLayoutThreadLooper"));
}
 
Example 8
Source File: SectionTreeTest.java    From litho with Apache License 2.0 5 votes vote down vote up
@Before
public void setup() throws Exception {
  mSectionContext = new SectionContext(getApplicationContext());
  mChangeSetThreadShadowLooper =
      Shadows.shadowOf(
          (Looper) Whitebox.invokeMethod(SectionTree.class, "getDefaultChangeSetThreadLooper"));
}
 
Example 9
Source File: LithoStatsSectionsTest.java    From litho with Apache License 2.0 5 votes vote down vote up
@Before
public void setup() {
  mSectionContext = new SectionContext(getApplicationContext());
  mChangeSetThreadShadowLooper =
      Shadows.shadowOf(
          (Looper) Whitebox.invokeMethod(SectionTree.class, "getDefaultChangeSetThreadLooper"));
}
 
Example 10
Source File: DemandFetcherTest.java    From prebid-mobile-android with Apache License 2.0 5 votes vote down vote up
@Test
public void testDestroyAutoRefresh() throws Exception {
    HttpUrl httpUrl = server.url("/");
    PrebidMobile.setApplicationContext(activity);
    Host.CUSTOM.setHostUrl(httpUrl.toString());
    PrebidMobile.setPrebidServerHost(Host.CUSTOM);
    server.enqueue(new MockResponse().setResponseCode(200).setBody(MockPrebidServerResponses.noBid()));
    server.enqueue(new MockResponse().setResponseCode(200).setBody(MockPrebidServerResponses.noBid()));
    server.enqueue(new MockResponse().setResponseCode(200).setBody(MockPrebidServerResponses.noBid()));
    PublisherAdRequest.Builder builder = new PublisherAdRequest.Builder();
    PublisherAdRequest request = builder.build();
    DemandFetcher demandFetcher = new DemandFetcher(request);
    PrebidMobile.setTimeoutMillis(Integer.MAX_VALUE);
    demandFetcher.setPeriodMillis(30);
    HashSet<AdSize> sizes = new HashSet<>();
    sizes.add(new AdSize(300, 250));
    RequestParams requestParams = new RequestParams("12345", AdType.BANNER, sizes);
    demandFetcher.setRequestParams(requestParams);
    OnCompleteListener mockListener = mock(OnCompleteListener.class);
    demandFetcher.setListener(mockListener);
    assertEquals(DemandFetcher.STATE.STOPPED, FieldUtils.readField(demandFetcher, "state", true));
    demandFetcher.start();
    assertEquals(DemandFetcher.STATE.RUNNING, FieldUtils.readField(demandFetcher, "state", true));
    ShadowLooper fetcherLooper = Shadows.shadowOf(demandFetcher.getHandler().getLooper());
    fetcherLooper.runOneTask();
    ShadowLooper demandLooper = Shadows.shadowOf(demandFetcher.getDemandHandler().getLooper());
    demandLooper.runOneTask();
    Robolectric.flushBackgroundThreadScheduler();
    Robolectric.flushForegroundThreadScheduler();
    assertEquals(DemandFetcher.STATE.RUNNING, FieldUtils.readField(demandFetcher, "state", true));
    demandFetcher.destroy();
    assertTrue(!Robolectric.getForegroundThreadScheduler().areAnyRunnable());
    assertTrue(!Robolectric.getBackgroundThreadScheduler().areAnyRunnable());
    assertEquals(DemandFetcher.STATE.DESTROYED, FieldUtils.readField(demandFetcher, "state", true));
    verify(mockListener, Mockito.times(1)).onComplete(ResultCode.NO_BIDS);
}
 
Example 11
Source File: ComponentTreeTest.java    From litho with Apache License 2.0 5 votes vote down vote up
@Before
public void setup() throws Exception {
  mContext = new ComponentContext(getApplicationContext());
  mComponent = SimpleMountSpecTester.create(mContext).build();

  mLayoutThreadShadowLooper =
      Shadows.shadowOf(
          (Looper) Whitebox.invokeMethod(ComponentTree.class, "getDefaultLayoutThreadLooper"));

  mWidthSpec = makeSizeSpec(39, EXACTLY);
  mWidthSpec2 = makeSizeSpec(40, EXACTLY);
  mHeightSpec = makeSizeSpec(41, EXACTLY);
  mHeightSpec2 = makeSizeSpec(42, EXACTLY);
}
 
Example 12
Source File: DemandFetcherTest.java    From prebid-mobile-android with Apache License 2.0 5 votes vote down vote up
@Test
public void testSingleRequestOneBidRubiconResponseForMoPubAdObject() throws Exception {
    HttpUrl httpUrl = server.url("/");
    PrebidMobile.setApplicationContext(activity);
    Host.CUSTOM.setHostUrl(httpUrl.toString());
    PrebidMobile.setPrebidServerHost(Host.CUSTOM);
    server.enqueue(new MockResponse().setResponseCode(200).setBody(MockPrebidServerResponses.oneBidFromRubicon()));
    MoPubView adView = new MoPubView(activity);
    adView.setAdUnitId("123456789");
    DemandFetcher demandFetcher = new DemandFetcher(adView);
    PrebidMobile.setTimeoutMillis(Integer.MAX_VALUE);
    demandFetcher.setPeriodMillis(0);
    HashSet<AdSize> sizes = new HashSet<>();
    sizes.add(new AdSize(300, 250));
    RequestParams requestParams = new RequestParams("12345", AdType.BANNER, sizes);
    demandFetcher.setRequestParams(requestParams);
    OnCompleteListener mockListener = mock(OnCompleteListener.class);
    demandFetcher.setListener(mockListener);
    assertEquals(DemandFetcher.STATE.STOPPED, FieldUtils.readField(demandFetcher, "state", true));
    demandFetcher.start();
    assertEquals(DemandFetcher.STATE.RUNNING, FieldUtils.readField(demandFetcher, "state", true));
    ShadowLooper fetcherLooper = Shadows.shadowOf(demandFetcher.getHandler().getLooper());
    fetcherLooper.runOneTask();
    ShadowLooper demandLooper = Shadows.shadowOf(demandFetcher.getDemandHandler().getLooper());
    demandLooper.runOneTask();
    Robolectric.flushBackgroundThreadScheduler();
    Robolectric.flushForegroundThreadScheduler();
    verify(mockListener).onComplete(ResultCode.SUCCESS);
    assertEquals(DemandFetcher.STATE.DESTROYED, FieldUtils.readField(demandFetcher, "state", true));
    String adViewKeywords = adView.getKeywords();
    assertEquals("hb_env:mobile-app,hb_cache_hostpath:https://prebid-cache-europe.rubiconproject.com/cache,hb_size_rubicon:300x250,hb_cache_id:a2f41588-4727-425c-9ef0-3b382debef1e,hb_cache_path_rubicon:/cache,hb_cache_host_rubicon:prebid-cache-europe.rubiconproject.com,hb_pb:1.20,hb_pb_rubicon:1.20,hb_cache_id_rubicon:a2f41588-4727-425c-9ef0-3b382debef1e,hb_cache_path:/cache,hb_size:300x250,hb_cache_hostpath_rubicon:https://prebid-cache-europe.rubiconproject.com/cache,hb_env_rubicon:mobile-app,hb_bidder:rubicon,hb_bidder_rubicon:rubicon,hb_cache_host:prebid-cache-europe.rubiconproject.com,", adViewKeywords);
}
 
Example 13
Source File: UTest.java    From Taskbar with Apache License 2.0 5 votes vote down vote up
@Test
public void testShowErrorDialog() {
    RunnableHooker onFinish = new RunnableHooker();
    String appOpCommand = "app-op-command";
    AlertDialog dialog =
            ReflectionHelpers.callStaticMethod(
                    U.class,
                    "showErrorDialog",
                    from(Context.class, context),
                    from(String.class, appOpCommand),
                    from(Callbacks.class, new Callbacks(null, onFinish))
            );
    ShadowAlertDialog shadowDialog = Shadows.shadowOf(dialog);
    Resources resources = context.getResources();
    assertEquals(
            resources.getString(R.string.tb_error_dialog_title),
            shadowDialog.getTitle()
    );
    assertEquals(
            resources.getString(
                    R.string.tb_error_dialog_message,
                    context.getPackageName(),
                    appOpCommand
            ),
            shadowDialog.getMessage()
    );
    Button button = dialog.getButton(AlertDialog.BUTTON_POSITIVE);
    assertEquals(resources.getString(R.string.tb_action_ok), button.getText());
    assertFalse(shadowDialog.isCancelable());
    button.performClick();
    assertTrue(onFinish.hasRun());
}
 
Example 14
Source File: ToastFrameworkImplTest.java    From Taskbar with Apache License 2.0 5 votes vote down vote up
@Test
public void testCancel() {
    impl.show();
    ShadowToast toast = Shadows.shadowOf(ShadowToast.getLatestToast());
    assertFalse(toast.isCancelled());
    impl.cancel();
    assertTrue(toast.isCancelled());
}
 
Example 15
Source File: TrafficStatsNetworkBytesCollectorTest.java    From Battery-Metrics with MIT License 5 votes vote down vote up
@Test
public void testBroadcastNetworkChanges() throws Exception {
  ShadowTrafficStats.setUidRxBytes(10000);
  ShadowTrafficStats.setUidTxBytes(20000);

  TrafficStatsNetworkBytesCollector collector =
      new TrafficStatsNetworkBytesCollector(RuntimeEnvironment.application);
  assertThat(collector.getTotalBytes(mBytes)).isTrue();

  ShadowTrafficStats.setUidRxBytes(11000);
  ShadowTrafficStats.setUidTxBytes(22000);

  ConnectivityManager connectivityManager =
      (ConnectivityManager)
          RuntimeEnvironment.application.getSystemService(Context.CONNECTIVITY_SERVICE);
  ShadowConnectivityManager shadowConnectivityManager = Shadows.shadowOf(connectivityManager);
  NetworkInfo networkInfo =
      ShadowNetworkInfo.newInstance(null, ConnectivityManager.TYPE_WIFI, 0, true, true);
  shadowConnectivityManager.setActiveNetworkInfo(networkInfo);
  collector.mReceiver.onReceive(null, null);

  ShadowTrafficStats.setUidRxBytes(11100);
  ShadowTrafficStats.setUidTxBytes(22200);
  assertThat(collector.getTotalBytes(mBytes)).isTrue();

  assertThat(mBytes[RX | MOBILE]).isEqualTo(11000);
  assertThat(mBytes[TX | MOBILE]).isEqualTo(22000);
  assertThat(mBytes[RX | WIFI]).isEqualTo(100);
  assertThat(mBytes[TX | WIFI]).isEqualTo(200);
}
 
Example 16
Source File: DemandFetcherTest.java    From prebid-mobile-android with Apache License 2.0 5 votes vote down vote up
@Test
public void testSingleRequestNoBidsResponse() throws Exception {
    HttpUrl httpUrl = server.url("/");
    PrebidMobile.setApplicationContext(activity);
    Host.CUSTOM.setHostUrl(httpUrl.toString());
    PrebidMobile.setPrebidServerHost(Host.CUSTOM);
    server.enqueue(new MockResponse().setResponseCode(200).setBody(MockPrebidServerResponses.noBid()));
    PublisherAdRequest.Builder builder = new PublisherAdRequest.Builder();
    PublisherAdRequest request = builder.build();
    DemandFetcher demandFetcher = new DemandFetcher(request);
    PrebidMobile.setTimeoutMillis(Integer.MAX_VALUE);
    demandFetcher.setPeriodMillis(0);
    HashSet<AdSize> sizes = new HashSet<>();
    sizes.add(new AdSize(300, 250));
    RequestParams requestParams = new RequestParams("12345", AdType.BANNER, sizes);
    demandFetcher.setRequestParams(requestParams);
    OnCompleteListener mockListener = mock(OnCompleteListener.class);
    demandFetcher.setListener(mockListener);
    assertEquals(DemandFetcher.STATE.STOPPED, FieldUtils.readField(demandFetcher, "state", true));
    demandFetcher.start();
    assertEquals(DemandFetcher.STATE.RUNNING, FieldUtils.readField(demandFetcher, "state", true));
    ShadowLooper fetcherLooper = Shadows.shadowOf(demandFetcher.getHandler().getLooper());
    fetcherLooper.runOneTask();
    ShadowLooper demandLooper = Shadows.shadowOf(demandFetcher.getDemandHandler().getLooper());
    demandLooper.runOneTask();
    Robolectric.flushBackgroundThreadScheduler();
    Robolectric.flushForegroundThreadScheduler();
    verify(mockListener).onComplete(ResultCode.NO_BIDS);
    assertEquals(DemandFetcher.STATE.DESTROYED, FieldUtils.readField(demandFetcher, "state", true));
}
 
Example 17
Source File: ComponentTreeTest.java    From litho with Apache License 2.0 4 votes vote down vote up
@Test
public void testSetRootAsyncWithCompatibleMeasureDuringLayout() throws InterruptedException {
  Component oldComponent =
      SimpleMountSpecTester.create(mContext).widthPx(100).heightPx(100).color(1234).build();
  ComponentTree componentTree = ComponentTree.create(mContext, oldComponent).build();
  componentTree.setLithoView(new LithoView(mContext));

  int widthSpec1 = SizeSpec.makeSizeSpec(1000, SizeSpec.EXACTLY);
  int heightSpec1 = SizeSpec.makeSizeSpec(1000, SizeSpec.AT_MOST);
  int widthSpec2 = SizeSpec.makeSizeSpec(1000, SizeSpec.EXACTLY);
  int heightSpec2 = SizeSpec.makeSizeSpec(500, SizeSpec.AT_MOST);

  componentTree.attach();
  componentTree.measure(widthSpec1, heightSpec1, new int[2], false);

  final TestDrawableComponent.BlockInPrepareComponentListener blockInPrepare =
      new TestDrawableComponent.BlockInPrepareComponentListener();
  blockInPrepare.setDoNotBlockOnThisThread();
  TestDrawableComponent newComponent =
      TestDrawableComponent.create(mContext).widthPx(100).heightPx(100).color(1234).build();
  newComponent.setTestComponentListener(blockInPrepare);

  componentTree.setRootAsync(newComponent);

  final TimeOutSemaphore asyncLayoutFinish =
      runOnBackgroundThread(
          new Runnable() {
            @Override
            public void run() {
              mLayoutThreadShadowLooper.runToEndOfTasks();
            }
          });

  blockInPrepare.awaitPrepareStart();

  // At this point, the Layout thread is blocked in prepare (waiting for unblockAsyncPrepare) and
  // will have already captured the "bad" specs, but not completed its layout.

  // This is a bit of a hack: Robolectric's ShadowLegacyLooper implementation is synchronized
  // on runToEndOfTasks and post(). Since we are simulating being in the middle of calculating a
  // layout, this means that we can't post() to the same Handler (as we will try to do in measure)
  // The "fix" here is to update the layout thread to a new handler/looper that can be controlled
  // separately.
  HandlerThread newHandlerThread = createAndStartNewHandlerThread();
  componentTree.updateLayoutThreadHandler(
      new LithoHandler.DefaultLithoHandler(newHandlerThread.getLooper()));
  ShadowLooper newThreadLooper = Shadows.shadowOf(newHandlerThread.getLooper());

  assertThat(componentTree.hasCompatibleLayout(widthSpec2, heightSpec2))
      .describedAs("Asserting test setup, second set of specs should be compatible already.")
      .isTrue();
  componentTree.measure(widthSpec2, heightSpec2, new int[2], false);

  assertThat(componentTree.getRoot()).isEqualTo(newComponent);
  assertThat(componentTree.hasCompatibleLayout(widthSpec2, heightSpec2)).isTrue();
  assertThat(componentTree.getMainThreadLayoutState().isForComponentId(newComponent.getId()))
      .isTrue()
      .withFailMessage(
          "The main thread should calculate a new layout synchronously because the async layout will not have compatible size specs");
  assertThat(componentTree.getMainThreadLayoutState().getHeight()).isEqualTo(100);

  // Finally, let the async layout finish and make sure it doesn't replace the layout from measure

  blockInPrepare.allowPrepareToComplete();
  asyncLayoutFinish.acquire();

  newComponent.setTestComponentListener(null);
  newThreadLooper.runToEndOfTasks();
  mLayoutThreadShadowLooper.runToEndOfTasks();
  ShadowLooper.runUiThreadTasks();

  assertThat(componentTree.getRoot()).isEqualTo(newComponent);
  assertThat(componentTree.hasCompatibleLayout(widthSpec2, heightSpec2)).isTrue();
  assertThat(componentTree.getMainThreadLayoutState().isForComponentId(newComponent.getId()))
      .isTrue();
  assertThat(componentTree.getMainThreadLayoutState().getHeight()).isEqualTo(100);

  assertThat(mLithoStatsRule.getComponentCalculateLayoutCount())
      .describedAs(
          "We expect one initial layout, the async layout (thrown away), and a final layout after measure.")
      .isEqualTo(3);

  newHandlerThread.quit();
}
 
Example 18
Source File: ComponentWarmerTest.java    From litho with Apache License 2.0 4 votes vote down vote up
@Test
public void testLazySyncPrepareWithHandler() {
  final ComponentWarmer warmer = new ComponentWarmer();

  final TestComponent component1 = new TestComponent("tag1");
  final ComponentRenderInfo renderInfo1 =
      ComponentRenderInfo.create()
          .component(component1)
          .customAttribute(ComponentWarmer.COMPONENT_WARMER_TAG, "tag1")
          .build();

  final TestComponent component2 = new TestComponent("tag2");
  final ComponentRenderInfo renderInfo2 =
      ComponentRenderInfo.create()
          .component(component2)
          .customAttribute(ComponentWarmer.COMPONENT_WARMER_TAG, "tag1")
          .build();

  final HandlerThread handlerThread = new HandlerThread("testt1");
  handlerThread.start();

  final Looper looper = handlerThread.getLooper();
  final LithoHandler.DefaultLithoHandler lithoHandler =
      new LithoHandler.DefaultLithoHandler(looper);

  warmer.prepare("tag1", renderInfo1, null, lithoHandler);
  warmer.prepare("tag2", renderInfo2, null, lithoHandler);

  RecyclerBinder binder = new RecyclerBinder.Builder().componentWarmer(warmer).build(mContext);

  assertThat(warmer.getPending().size()).isEqualTo(2);
  assertThat(warmer.getCache().get("tag1")).isNull();
  assertThat(warmer.getCache().get("tag2")).isNull();

  binder.measure(new Size(), mWidthSpec, mHeightSpec, null);

  assertThat(warmer.getPending()).isEmpty();

  ShadowLooper shadowLooper = Shadows.shadowOf(looper);
  shadowLooper.runToEndOfTasks();

  final ComponentTreeHolder holder1 = warmer.getCache().get("tag1");
  assertThat(holder1).isNotNull();
  assertThat(holder1.isTreeValid()).isTrue();

  final ComponentTreeHolder holder2 = warmer.getCache().get("tag2");
  assertThat(holder2).isNotNull();
  assertThat(holder2.isTreeValid()).isTrue();

  assertThat(component1.ranLayout.get()).isTrue();
  assertThat(component2.ranLayout.get()).isTrue();
}
 
Example 19
Source File: WXDomManagerTest.java    From weex-uikit with MIT License 4 votes vote down vote up
public static ShadowLooper getLooper() {
  return Shadows.shadowOf(WXSDKManager.getInstance().getWXDomManager().mDomHandler.getLooper());
}
 
Example 20
Source File: CredentialClientTest.java    From OpenYOLO-Android with Apache License 2.0 4 votes vote down vote up
private ShadowActivity startFinishWithResultActivity(Intent intent) {
    return Shadows.shadowOf(
            Robolectric.buildActivity(FinishWithResultActivity.class, intent).create().get());
}