MraidVideoPlayerActivity extends BaseVideoPlayerActivity implements BaseVideoViewController.BaseVideoViewControllerListener { @Override public void onStartActivityForResult(final Class<? extends Activity> clazz, final int requestCode, final Bundle extras) { if (clazz == null) { return; } final Intent intent = IntentUtils.getStartActivityIntent(this, clazz, extras); try { startActivityForResult(intent, requestCode); } catch (ActivityNotFoundException e) { MoPubLog.d("Activity " + clazz.getName() + " not found. Did you declare it in your AndroidManifest.xml?"); } }  @Override void onBackPressed(); @Override void onSetContentView(final View view); @Override void onSetRequestedOrientation(final int requestedOrientation); @Override void onFinish(); @Override void onStartActivityForResult(final Class<? extends Activity> clazz,
            final int requestCode,
            final Bundle extras);  }
@Test public void onStartActivityForResult_shouldStartAnActivityWithRelevantRequestCodeAndExtras() throws Exception { initializeSubjectWithMockViewController(); final Bundle expectedExtras = new Bundle(); expectedExtras.putString("hello", "goodbye"); subject.onStartActivityForResult(MoPubBrowser.class, 100, expectedExtras); final ShadowActivity.IntentForResult intentForResult = shadowOf(subject).getNextStartedActivityForResult(); assertThat(intentForResult.intent.getComponent().getClassName()).isEqualTo("com.mopub.common.MoPubBrowser"); assertThat(intentForResult.intent.getExtras()).isEqualTo(expectedExtras); assertThat(intentForResult.requestCode).isEqualTo(100); }
@Test public void onStartActivityForResult_withNullClass_shouldNotStartAnActivity() throws Exception { initializeSubjectWithMockViewController(); subject.onStartActivityForResult(null, 100, new Bundle()); final ShadowActivity.IntentForResult intentForResult = shadowOf(subject).getNextStartedActivityForResult(); assertThat(intentForResult).isNull(); }