Commit c615367a authored by Adithya Srinivasan's avatar Adithya Srinivasan Committed by Commit Bot

Portals: Fix flakes in testTouchTransferAcrossReactivation

The flakes were caused by crbug.com/1098773. As a workaround until the
issue is fixed, this wraps the activate call in a setTimeout.

Bug: 1024850
Change-Id: I36e2b948818d81578acc97a9a60758b281ff6764
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2264856Reviewed-by: default avatarDavid Trainor <dtrainor@chromium.org>
Commit-Queue: Adithya Srinivasan <adithyas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#782379}
parent 01ef63e3
...@@ -31,7 +31,6 @@ import org.chromium.base.ContextUtils; ...@@ -31,7 +31,6 @@ import org.chromium.base.ContextUtils;
import org.chromium.base.ThreadUtils; import org.chromium.base.ThreadUtils;
import org.chromium.base.test.util.CallbackHelper; import org.chromium.base.test.util.CallbackHelper;
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.Feature; import org.chromium.base.test.util.Feature;
import org.chromium.base.test.util.MinAndroidSdkLevel; import org.chromium.base.test.util.MinAndroidSdkLevel;
import org.chromium.chrome.R; import org.chromium.chrome.R;
...@@ -355,7 +354,6 @@ public class PortalsTest { ...@@ -355,7 +354,6 @@ public class PortalsTest {
@Test @Test
@MediumTest @MediumTest
@Feature({"Portals"}) @Feature({"Portals"})
@DisabledTest(message = "https://crbug.com/1024850")
public void testTouchTransferAfterReactivation() throws Exception { public void testTouchTransferAfterReactivation() throws Exception {
mActivityTestRule.startMainActivityWithURL(mTestServer.getURL( mActivityTestRule.startMainActivityWithURL(mTestServer.getURL(
"/chrome/test/data/android/portals/touch-transfer-after-reactivation.html")); "/chrome/test/data/android/portals/touch-transfer-after-reactivation.html"));
......
...@@ -2,10 +2,18 @@ ...@@ -2,10 +2,18 @@
<html> <html>
<body> <body>
<script> <script>
const urlParams = new URLSearchParams(window.location.search);
const withTimeout = urlParams.has('withTimeout')
window.onportalactivate = e => { window.onportalactivate = e => {
var portal = e.adoptPredecessor(); var portal = e.adoptPredecessor();
document.body.appendChild(portal); document.body.appendChild(portal);
portal.activate(); if (!withTimeout) {
portal.activate();
} else {
setTimeout(() => {
portal.activate();
});
}
} }
</script> </script>
</body> </body>
......
...@@ -11,7 +11,8 @@ ...@@ -11,7 +11,8 @@
</head> </head>
<body> <body>
<div id="scroller"></div> <div id="scroller"></div>
<portal src="activate-predecessor.html"></portal> <!-- TODO(crbug.com/1098773): The timeout shouldn't be necessary. -->
<portal src="activate-predecessor.html?withTimeout"></portal>
<script> <script>
document.body.addEventListener('touchstart', e => { document.body.addEventListener('touchstart', e => {
var portal = document.querySelector('portal'); var portal = document.querySelector('portal');
......
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