Commit ddd81e39 authored by Michael Thiessen's avatar Michael Thiessen Committed by Chromium LUCI CQ

Revert "Speculative de-flake of TabsOpenedFromExternalAppTest"

This reverts commit 7973b6e9.

Reason for revert: Didn't work.

Original change's description:
> Speculative de-flake of TabsOpenedFromExternalAppTest
>
> It looks like when we send CTA to the background, then call finish()
> on it, it doesn't actually get Finished. Likely Android just doesn't
> bother actually finishing background Activities right away (maybe
> something to do with the launcher)?
>
> I haven't been able to reproduce the issue, but this appears to be the
> commonality between the failing tests, and this should fix it if so.
>
> If this works, I'll follow up with some infra changes to detect/advise
> in this case.
>
> Bug: 1153712
> Change-Id: Ic46c30c99df390e0cf8c7d732c3a10535dddc2a8
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2565619
> Commit-Queue: Michael Thiessen <mthiesse@chromium.org>
> Reviewed-by: Yaron Friedman <yfriedman@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#832044}

TBR=yfriedman@chromium.org,mthiesse@chromium.org,chromium-scoped@luci-project-accounts.iam.gserviceaccount.com

Change-Id: Ie5de0f86935d1a11cc3c6dd821569d6736c33d08
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1153712
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2566721Reviewed-by: default avatarMichael Thiessen <mthiesse@chromium.org>
Commit-Queue: Michael Thiessen <mthiesse@chromium.org>
Cr-Commit-Position: refs/heads/master@{#832207}
parent 2d5b42ff
......@@ -386,7 +386,7 @@ public class TabsOpenedFromExternalAppTest {
@Test
@LargeTest
@Feature({"Navigation"})
public void testNoNewTabForSameApp() throws Exception {
public void testNoNewTabForSameApp() {
mActivityTestRule.startMainActivityOnBlankPage();
String url1 = mTestServer.getURL("/chrome/test/data/android/google.html");
......@@ -418,7 +418,6 @@ public class TabsOpenedFromExternalAppTest {
TestThreadUtils.runOnUiThreadBlocking(
() -> mActivityTestRule.getActivity().onBackPressed());
CriteriaHelper.pollUiThread(() -> !mActivityTestRule.getActivity().hasWindowFocus());
mActivityTestRule.resumeMainActivityFromLauncher();
}
/**
......@@ -428,7 +427,7 @@ public class TabsOpenedFromExternalAppTest {
@Test
@LargeTest
@Feature({"Navigation"})
public void testNewTabForUnknownApp() throws Exception {
public void testNewTabForUnknownApp() {
mActivityTestRule.startMainActivityOnBlankPage();
String url1 = mTestServer.getURL("/chrome/test/data/android/google.html");
......@@ -466,7 +465,6 @@ public class TabsOpenedFromExternalAppTest {
TestThreadUtils.runOnUiThreadBlocking(
() -> mActivityTestRule.getActivity().onBackPressed());
CriteriaHelper.pollUiThread(() -> !mActivityTestRule.getActivity().hasWindowFocus());
mActivityTestRule.resumeMainActivityFromLauncher();
}
/**
......@@ -476,7 +474,7 @@ public class TabsOpenedFromExternalAppTest {
@Test
@LargeTest
@Feature({"Navigation"})
public void testNewTabWithNewTabExtra() throws Exception {
public void testNewTabWithNewTabExtra() {
mActivityTestRule.startMainActivityOnBlankPage();
String url1 = mTestServer.getURL("/chrome/test/data/android/google.html");
......@@ -508,7 +506,6 @@ public class TabsOpenedFromExternalAppTest {
TestThreadUtils.runOnUiThreadBlocking(
() -> mActivityTestRule.getActivity().onBackPressed());
CriteriaHelper.pollUiThread(() -> !mActivityTestRule.getActivity().hasWindowFocus());
mActivityTestRule.resumeMainActivityFromLauncher();
}
/**
......@@ -518,7 +515,7 @@ public class TabsOpenedFromExternalAppTest {
@Test
@LargeTest
@Feature({"Navigation", "Main"})
public void testNoNewTabForSameAppOnStart() throws Exception {
public void testNoNewTabForSameAppOnStart() {
String url1 = mTestServer.getURL("/chrome/test/data/android/google.html");
String url2 = mTestServer.getURL("/chrome/test/data/android/about.html");
......@@ -543,7 +540,6 @@ public class TabsOpenedFromExternalAppTest {
TestThreadUtils.runOnUiThreadBlocking(
() -> mActivityTestRule.getActivity().onBackPressed());
CriteriaHelper.pollUiThread(() -> !mActivityTestRule.getActivity().hasWindowFocus());
mActivityTestRule.resumeMainActivityFromLauncher();
}
/**
......
......@@ -53,9 +53,8 @@ public class ChromeTabbedActivityTestRule extends ChromeActivityTestRule<ChromeT
public void resumeMainActivityFromLauncher() throws Exception {
Assert.assertNotNull(getActivity());
@ActivityState
int state = ApplicationStatus.getStateForActivity(getActivity());
Assert.assertTrue(state == ActivityState.STOPPED || state == ActivityState.PAUSED);
Assert.assertEquals(
ApplicationStatus.getStateForActivity(getActivity()), ActivityState.STOPPED);
Intent launchIntent = getActivity().getPackageManager().getLaunchIntentForPackage(
getActivity().getPackageName());
......
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