Commit 480948fd authored by Pavel Shmakov's avatar Pavel Shmakov Committed by Commit Bot

Work around desugaring issue with tests

Use full classpath for desugar as a temporary measure against the desugaring issue in tests.

Bug: 860018, 885273
Change-Id: I0d314dceb31c7df2176bfa6fab452afaa541e22c
Reviewed-on: https://chromium-review.googlesource.com/1236434Reviewed-by: default avatarTed Choc <tedchoc@chromium.org>
Reviewed-by: default avataragrieve <agrieve@chromium.org>
Commit-Queue: Pavel Shmakov <pshmakov@chromium.org>
Cr-Commit-Position: refs/heads/master@{#593742}
parent 9287cecf
......@@ -1344,7 +1344,10 @@ if (enable_java_templates) {
rebase_path(_desugar_input_jar, root_build_dir),
"--output-jar",
rebase_path(_desugar_output_jar, root_build_dir),
"--classpath=@FileArg($_rebased_build_config:javac:interface_classpath)",
# Temporarily using java_full_interface_classpath until classpath validation of targets
# is implemented, see http://crbug.com/885273
"--classpath=@FileArg($_rebased_build_config:deps_info:javac_full_interface_classpath)",
"--bootclasspath=@FileArg($_rebased_build_config:android:sdk_interface_jars)",
]
}
......
......@@ -28,7 +28,6 @@ import org.chromium.chrome.browser.test.ScreenShooter;
import org.chromium.chrome.browser.toolbar.CustomTabToolbar;
import org.chromium.chrome.browser.util.ColorUtils;
import org.chromium.chrome.test.ChromeJUnit4ClassRunner;
import org.chromium.content_public.browser.test.util.Criteria;
import org.chromium.content_public.browser.test.util.CriteriaHelper;
import java.util.concurrent.ExecutionException;
......@@ -101,12 +100,7 @@ public class CustomTabActivityIncognitoTest {
IncognitoNotificationService.getRemoveAllIncognitoTabsIntent(mActivity).send();
CriteriaHelper.pollUiThread(new Criteria() {
@Override
public boolean isSatisfied() {
return mActivity.isFinishing();
}
});
CriteriaHelper.pollUiThread(mActivity::isFinishing);
}
@Test
......
......@@ -24,7 +24,6 @@ import org.chromium.content_public.browser.test.util.Criteria;
import org.chromium.content_public.browser.test.util.CriteriaHelper;
import java.lang.ref.WeakReference;
import java.util.List;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
......@@ -43,20 +42,15 @@ public class CustomTabActivityTestRule extends ChromeActivityTestRule<CustomTabA
public void startActivityCompletely(Intent intent) {
Activity activity = InstrumentationRegistry.getInstrumentation().startActivitySync(intent);
Assert.assertNotNull("Main activity did not start", activity);
CriteriaHelper.pollUiThread(new Criteria() {
@Override
public boolean isSatisfied() {
List<WeakReference<Activity>> list = ApplicationStatus.getRunningActivities();
for (WeakReference<Activity> ref : list) {
Activity activity = ref.get();
if (activity == null) continue;
if (activity instanceof CustomTabActivity) {
setActivity((CustomTabActivity) activity);
return true;
}
CriteriaHelper.pollUiThread(() -> {
for (WeakReference<Activity> ref : ApplicationStatus.getRunningActivities()) {
Activity runningActivity = ref.get();
if (runningActivity instanceof CustomTabActivity) {
setActivity((CustomTabActivity) runningActivity);
return true;
}
return false;
}
return false;
});
}
......@@ -89,12 +83,10 @@ public class CustomTabActivityTestRule extends ChromeActivityTestRule<CustomTabA
} catch (TimeoutException e) {
Assert.fail();
}
CriteriaHelper.pollUiThread(new Criteria("Deferred startup never completed") {
@Override
public boolean isSatisfied() {
return DeferredStartupHandler.getInstance().isDeferredStartupCompleteForApp();
}
}, STARTUP_TIMEOUT_MS, CriteriaHelper.DEFAULT_POLLING_INTERVAL);
CriteriaHelper.pollUiThread(
DeferredStartupHandler.getInstance()::isDeferredStartupCompleteForApp,
"Deferred startup never completed", STARTUP_TIMEOUT_MS,
CriteriaHelper.DEFAULT_POLLING_INTERVAL);
Assert.assertNotNull(tab);
Assert.assertNotNull(tab.getView());
Assert.assertTrue(tab.isCurrentlyACustomTab());
......
......@@ -23,7 +23,6 @@ import org.chromium.base.ThreadUtils;
import org.chromium.base.test.util.CallbackHelper;
import org.chromium.chrome.R;
import org.chromium.chrome.browser.document.ChromeLauncherActivity;
import org.chromium.content_public.browser.test.util.Criteria;
import org.chromium.content_public.browser.test.util.CriteriaHelper;
import java.util.concurrent.TimeoutException;
......@@ -101,18 +100,10 @@ public class CustomTabsTestUtils {
}
public static void openAppMenuAndAssertMenuShown(CustomTabActivity activity) {
ThreadUtils.runOnUiThread(new Runnable() {
@Override
public void run() {
activity.onMenuOrKeyboardAction(R.id.show_menu, false);
}
});
ThreadUtils.runOnUiThread(
() -> { activity.onMenuOrKeyboardAction(R.id.show_menu, false); });
CriteriaHelper.pollUiThread(new Criteria("App menu was not shown") {
@Override
public boolean isSatisfied() {
return activity.getAppMenuHandler().isAppMenuShowing();
}
});
CriteriaHelper.pollUiThread(
activity.getAppMenuHandler()::isAppMenuShowing, "App menu was not shown");
}
}
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