Commit f068cbc9 authored by Rohit Agarwal's avatar Rohit Agarwal Committed by Chromium LUCI CQ

Add Incognito CCT landscape mode tests.

Bug: 1168161
Change-Id: I776a8f152a05cde5fbb939a707ee0e8eba43b083
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2640033Reviewed-by: default avatarPeter Conn <peconn@chromium.org>
Commit-Queue: Rohit Agarwal <roagarwal@chromium.org>
Cr-Commit-Position: refs/heads/master@{#845288}
parent 8315fdfa
...@@ -7,6 +7,7 @@ package org.chromium.chrome.browser.customtabs; ...@@ -7,6 +7,7 @@ package org.chromium.chrome.browser.customtabs;
import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertTrue;
import android.content.Intent; import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.support.test.InstrumentationRegistry; import android.support.test.InstrumentationRegistry;
import android.view.View; import android.view.View;
...@@ -86,16 +87,30 @@ public class IncognitoCustomTabActivityRenderTest { ...@@ -86,16 +87,30 @@ public class IncognitoCustomTabActivityRenderTest {
InstrumentationRegistry.getContext(), url); InstrumentationRegistry.getContext(), url);
} }
private void startActivity(String renderTestId) throws IOException { private void startActivity(String renderTestId, int mScreenOrientation) throws IOException {
mCustomTabActivityTestRule.startCustomTabActivityWithIntent(mIntent); mCustomTabActivityTestRule.startCustomTabActivityWithIntent(mIntent);
mCustomTabActivityTestRule.getActivity().setRequestedOrientation(mScreenOrientation);
InstrumentationRegistry.getInstrumentation().waitForIdleSync();
View toolbarView = mCustomTabActivityTestRule.getActivity().findViewById(R.id.toolbar); View toolbarView = mCustomTabActivityTestRule.getActivity().findViewById(R.id.toolbar);
mRenderTestRule.render(toolbarView, renderTestId); mRenderTestRule.render(toolbarView, renderTestId);
} }
private void startActivity(String renderTestId) throws IOException {
startActivity(renderTestId, ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED);
}
@Test @Test
@MediumTest @MediumTest
@Feature("RenderTest") @Feature("RenderTest")
public void testCCTToolbar() throws IOException { public void testCCTToolbar() throws IOException {
startActivity("default_incognito_cct_toolbar_with_https_" + mRunWithHttps); startActivity("default_incognito_cct_toolbar_with_https_" + mRunWithHttps);
} }
@Test
@MediumTest
@Feature("RenderTest")
public void testCCTToolbarInLandscapeMode() throws IOException {
startActivity("default_incognito_cct_toolbar_in_landscape_with_https_" + mRunWithHttps,
ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
}
} }
\ No newline at end of file
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