Commit 916a6ce1 authored by Aidan Wolter's avatar Aidan Wolter Committed by Commit Bot

Add headless arg to CastWebContentsComponentTest

This CL adds the required test changes for the recent CL that added the
headless argument to CastWebContentsComponent.

Bug: None
Test: None
Change-Id: I7e6a2d229b5c7c78067c158547662463b690f93e
Reviewed-on: https://chromium-review.googlesource.com/663300
Commit-Queue: Aidan Wolter <awolter@chromium.org>
Reviewed-by: default avatarLuke Halliwell <halliwell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#501521}
parent 8e3b5543
......@@ -60,7 +60,8 @@ public class CastWebContentsComponentTest {
public void testStartStartsWebContentsActivity() {
Assume.assumeFalse(BuildConfig.DISPLAY_WEB_CONTENTS_IN_SERVICE);
CastWebContentsComponent component = new CastWebContentsComponent(INSTANCE_ID, null, null);
CastWebContentsComponent component =
new CastWebContentsComponent(INSTANCE_ID, null, null, false);
component.start(mActivity, mWebContents);
Intent intent = mShadowActivity.getNextStartedActivity();
Assert.assertEquals(
......@@ -80,7 +81,8 @@ public class CastWebContentsComponentTest {
intentFilter.addDataPath("/" + INSTANCE_ID, PatternMatcher.PATTERN_LITERAL);
LocalBroadcastManager.getInstance(mActivity).registerReceiver(receiver, intentFilter);
CastWebContentsComponent component = new CastWebContentsComponent(INSTANCE_ID, null, null);
CastWebContentsComponent component =
new CastWebContentsComponent(INSTANCE_ID, null, null, false);
component.start(mActivity, mWebContents);
component.stop(mActivity);
......@@ -93,7 +95,8 @@ public class CastWebContentsComponentTest {
public void testStartBindsWebContentsService() {
Assume.assumeTrue(BuildConfig.DISPLAY_WEB_CONTENTS_IN_SERVICE);
CastWebContentsComponent component = new CastWebContentsComponent(INSTANCE_ID, null, null);
CastWebContentsComponent component =
new CastWebContentsComponent(INSTANCE_ID, null, null, false);
component.start(mActivity, mWebContents);
component.stop(mActivity);
......@@ -108,7 +111,8 @@ public class CastWebContentsComponentTest {
public void testStopUnbindsWebContentsService() {
Assume.assumeTrue(BuildConfig.DISPLAY_WEB_CONTENTS_IN_SERVICE);
CastWebContentsComponent component = new CastWebContentsComponent(INSTANCE_ID, null, null);
CastWebContentsComponent component =
new CastWebContentsComponent(INSTANCE_ID, null, null, false);
component.start(mActivity, mWebContents);
component.stop(mActivity);
......@@ -121,7 +125,7 @@ public class CastWebContentsComponentTest {
Mockito.mock(CastWebContentsComponent.OnComponentClosedHandler.class);
CastWebContentsComponent component =
new CastWebContentsComponent(INSTANCE_ID, callback, null);
new CastWebContentsComponent(INSTANCE_ID, callback, null, false);
component.start(mActivity, mWebContents);
CastWebContentsComponent.onComponentClosed(mActivity, INSTANCE_ID);
verify(callback).onComponentClosed();
......@@ -135,7 +139,7 @@ public class CastWebContentsComponentTest {
Mockito.mock(CastWebContentsComponent.OnKeyDownHandler.class);
CastWebContentsComponent component =
new CastWebContentsComponent(INSTANCE_ID, null, callback);
new CastWebContentsComponent(INSTANCE_ID, null, callback, false);
component.start(mActivity, mWebContents);
CastWebContentsComponent.onKeyDown(mActivity, INSTANCE_ID, 42);
component.stop(mActivity);
......@@ -145,7 +149,8 @@ public class CastWebContentsComponentTest {
@Test
public void testStopDoesNotUnbindServiceIfStartWasNotCalled() {
CastWebContentsComponent component = new CastWebContentsComponent(INSTANCE_ID, null, null);
CastWebContentsComponent component =
new CastWebContentsComponent(INSTANCE_ID, null, null, false);
component.stop(mActivity);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment