Commit 2c36a5f3 authored by Brandon Wylie's avatar Brandon Wylie Committed by Commit Bot

Revert "[Paint Preview] Attempt to fix test in StartupPaintPreviewHelperTest"

This reverts commit 92f89de1.

Reason for revert: Failing on Lollipop Phone Tester

Original change's description:
> [Paint Preview] Attempt to fix test in StartupPaintPreviewHelperTest
>
> This attepts to fix StartupPaintPreviewHelperTest#testDisplayOnStartup
> by waiting for activity to be destroyed first.
>
> Bug: 1145783
> Change-Id: Icd949712cb348dc12829a6eddec17b86045d2c35
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2533030
> Reviewed-by: Calder Kitagawa <ckitagawa@chromium.org>
> Commit-Queue: Mehran Mahmoudi <mahmoudi@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#826481}

TBR=mahmoudi@chromium.org,ckitagawa@chromium.org

Change-Id: Ib158454c9c3616a1082a3f25fb14c8ec03799331
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1145783
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2535211Reviewed-by: default avatarBrandon Wylie <wylieb@chromium.org>
Commit-Queue: Brandon Wylie <wylieb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#826830}
parent 020e1eb7
...@@ -17,8 +17,8 @@ import org.junit.runner.RunWith; ...@@ -17,8 +17,8 @@ import org.junit.runner.RunWith;
import org.chromium.base.test.params.ParameterizedCommandLineFlags; import org.chromium.base.test.params.ParameterizedCommandLineFlags;
import org.chromium.base.test.params.ParameterizedCommandLineFlags.Switches; import org.chromium.base.test.params.ParameterizedCommandLineFlags.Switches;
import org.chromium.base.test.util.CommandLineFlags; import org.chromium.base.test.util.CommandLineFlags;
import org.chromium.base.test.util.DisabledTest;
import org.chromium.base.test.util.Restriction; import org.chromium.base.test.util.Restriction;
import org.chromium.chrome.browser.ChromeTabbedActivity;
import org.chromium.chrome.browser.flags.ChromeFeatureList; import org.chromium.chrome.browser.flags.ChromeFeatureList;
import org.chromium.chrome.browser.flags.ChromeSwitches; import org.chromium.chrome.browser.flags.ChromeSwitches;
import org.chromium.chrome.browser.paint_preview.services.PaintPreviewTabServiceFactory; import org.chromium.chrome.browser.paint_preview.services.PaintPreviewTabServiceFactory;
...@@ -31,8 +31,9 @@ import org.chromium.content_public.browser.test.util.TestThreadUtils; ...@@ -31,8 +31,9 @@ import org.chromium.content_public.browser.test.util.TestThreadUtils;
import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutionException;
/** /**
* Tests for the {@link StartupPaintPreviewHelper} class. This test suite cannot be batched because * Tests for the {@link StartupPaintPreviewHelper} class.
* tests rely on the cold start behavior of {@link ChromeActivity}. * This test suite cannot be batched because tests rely on the cold start behavior of
* {@link ChromeActivity}.
*/ */
@RunWith(StartupPaintPreviewHelperTestRunner.class) @RunWith(StartupPaintPreviewHelperTestRunner.class)
@Features.EnableFeatures({ChromeFeatureList.PAINT_PREVIEW_SHOW_ON_STARTUP}) @Features.EnableFeatures({ChromeFeatureList.PAINT_PREVIEW_SHOW_ON_STARTUP})
...@@ -94,20 +95,17 @@ public class StartupPaintPreviewHelperTest { ...@@ -94,20 +95,17 @@ public class StartupPaintPreviewHelperTest {
@Test @Test
@MediumTest @MediumTest
@Restriction(StartupPaintPreviewHelperTestRunner.RESTRICTION_TYPE_KEEP_ACTIVITIES) @Restriction(StartupPaintPreviewHelperTestRunner.RESTRICTION_TYPE_KEEP_ACTIVITIES)
@DisabledTest(message = "https://crbug.com/1145783")
public void testDisplayOnStartup() throws ExecutionException { public void testDisplayOnStartup() throws ExecutionException {
mActivityTestRule.startMainActivityWithURL( mActivityTestRule.startMainActivityWithURL(
mActivityTestRule.getTestServer().getURL(TEST_URL)); mActivityTestRule.getTestServer().getURL(TEST_URL));
// Send Chrome to background to trigger capture. // Send Chrome to background to trigger capture.
UiDevice.getInstance(InstrumentationRegistry.getInstrumentation()).pressHome(); UiDevice.getInstance(InstrumentationRegistry.getInstrumentation()).pressHome();
ChromeTabbedActivity firstActivity = mActivityTestRule.getActivity(); assertHasCaptureForTab(mActivityTestRule.getActivity().getActivityTab(), true);
assertHasCaptureForTab(firstActivity.getActivityTab(), true);
// Restart Chrome. Paint preview should be shown on startup. // Restart Chrome. Paint preview should be shown on startup.
TestThreadUtils.runOnUiThreadBlocking(firstActivity::finish); TestThreadUtils.runOnUiThreadBlocking(() -> mActivityTestRule.getActivity().finish());
CriteriaHelper.pollInstrumentationThread(
firstActivity::isDestroyed, "Activity is not destroyed.");
mActivityTestRule.startMainActivityFromLauncher(); mActivityTestRule.startMainActivityFromLauncher();
final Tab tab = mActivityTestRule.getActivity().getActivityTab(); final Tab tab = mActivityTestRule.getActivity().getActivityTab();
TabbedPaintPreview tabbedPaintPreview = TabbedPaintPreview tabbedPaintPreview =
......
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