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) { ...@@ -1344,7 +1344,10 @@ if (enable_java_templates) {
rebase_path(_desugar_input_jar, root_build_dir), rebase_path(_desugar_input_jar, root_build_dir),
"--output-jar", "--output-jar",
rebase_path(_desugar_output_jar, root_build_dir), 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)", "--bootclasspath=@FileArg($_rebased_build_config:android:sdk_interface_jars)",
] ]
} }
......
...@@ -28,7 +28,6 @@ import org.chromium.chrome.browser.test.ScreenShooter; ...@@ -28,7 +28,6 @@ import org.chromium.chrome.browser.test.ScreenShooter;
import org.chromium.chrome.browser.toolbar.CustomTabToolbar; import org.chromium.chrome.browser.toolbar.CustomTabToolbar;
import org.chromium.chrome.browser.util.ColorUtils; import org.chromium.chrome.browser.util.ColorUtils;
import org.chromium.chrome.test.ChromeJUnit4ClassRunner; 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 org.chromium.content_public.browser.test.util.CriteriaHelper;
import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutionException;
...@@ -101,12 +100,7 @@ public class CustomTabActivityIncognitoTest { ...@@ -101,12 +100,7 @@ public class CustomTabActivityIncognitoTest {
IncognitoNotificationService.getRemoveAllIncognitoTabsIntent(mActivity).send(); IncognitoNotificationService.getRemoveAllIncognitoTabsIntent(mActivity).send();
CriteriaHelper.pollUiThread(new Criteria() { CriteriaHelper.pollUiThread(mActivity::isFinishing);
@Override
public boolean isSatisfied() {
return mActivity.isFinishing();
}
});
} }
@Test @Test
......
...@@ -24,7 +24,6 @@ import org.chromium.content_public.browser.test.util.Criteria; ...@@ -24,7 +24,6 @@ import org.chromium.content_public.browser.test.util.Criteria;
import org.chromium.content_public.browser.test.util.CriteriaHelper; import org.chromium.content_public.browser.test.util.CriteriaHelper;
import java.lang.ref.WeakReference; import java.lang.ref.WeakReference;
import java.util.List;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException; import java.util.concurrent.TimeoutException;
...@@ -43,20 +42,15 @@ public class CustomTabActivityTestRule extends ChromeActivityTestRule<CustomTabA ...@@ -43,20 +42,15 @@ public class CustomTabActivityTestRule extends ChromeActivityTestRule<CustomTabA
public void startActivityCompletely(Intent intent) { public void startActivityCompletely(Intent intent) {
Activity activity = InstrumentationRegistry.getInstrumentation().startActivitySync(intent); Activity activity = InstrumentationRegistry.getInstrumentation().startActivitySync(intent);
Assert.assertNotNull("Main activity did not start", activity); Assert.assertNotNull("Main activity did not start", activity);
CriteriaHelper.pollUiThread(new Criteria() { CriteriaHelper.pollUiThread(() -> {
@Override for (WeakReference<Activity> ref : ApplicationStatus.getRunningActivities()) {
public boolean isSatisfied() { Activity runningActivity = ref.get();
List<WeakReference<Activity>> list = ApplicationStatus.getRunningActivities(); if (runningActivity instanceof CustomTabActivity) {
for (WeakReference<Activity> ref : list) { setActivity((CustomTabActivity) runningActivity);
Activity activity = ref.get(); return true;
if (activity == null) continue;
if (activity instanceof CustomTabActivity) {
setActivity((CustomTabActivity) activity);
return true;
}
} }
return false;
} }
return false;
}); });
} }
...@@ -89,12 +83,10 @@ public class CustomTabActivityTestRule extends ChromeActivityTestRule<CustomTabA ...@@ -89,12 +83,10 @@ public class CustomTabActivityTestRule extends ChromeActivityTestRule<CustomTabA
} catch (TimeoutException e) { } catch (TimeoutException e) {
Assert.fail(); Assert.fail();
} }
CriteriaHelper.pollUiThread(new Criteria("Deferred startup never completed") { CriteriaHelper.pollUiThread(
@Override DeferredStartupHandler.getInstance()::isDeferredStartupCompleteForApp,
public boolean isSatisfied() { "Deferred startup never completed", STARTUP_TIMEOUT_MS,
return DeferredStartupHandler.getInstance().isDeferredStartupCompleteForApp(); CriteriaHelper.DEFAULT_POLLING_INTERVAL);
}
}, STARTUP_TIMEOUT_MS, CriteriaHelper.DEFAULT_POLLING_INTERVAL);
Assert.assertNotNull(tab); Assert.assertNotNull(tab);
Assert.assertNotNull(tab.getView()); Assert.assertNotNull(tab.getView());
Assert.assertTrue(tab.isCurrentlyACustomTab()); Assert.assertTrue(tab.isCurrentlyACustomTab());
......
...@@ -23,7 +23,6 @@ import org.chromium.base.ThreadUtils; ...@@ -23,7 +23,6 @@ import org.chromium.base.ThreadUtils;
import org.chromium.base.test.util.CallbackHelper; import org.chromium.base.test.util.CallbackHelper;
import org.chromium.chrome.R; import org.chromium.chrome.R;
import org.chromium.chrome.browser.document.ChromeLauncherActivity; 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 org.chromium.content_public.browser.test.util.CriteriaHelper;
import java.util.concurrent.TimeoutException; import java.util.concurrent.TimeoutException;
...@@ -101,18 +100,10 @@ public class CustomTabsTestUtils { ...@@ -101,18 +100,10 @@ public class CustomTabsTestUtils {
} }
public static void openAppMenuAndAssertMenuShown(CustomTabActivity activity) { public static void openAppMenuAndAssertMenuShown(CustomTabActivity activity) {
ThreadUtils.runOnUiThread(new Runnable() { ThreadUtils.runOnUiThread(
@Override () -> { activity.onMenuOrKeyboardAction(R.id.show_menu, false); });
public void run() {
activity.onMenuOrKeyboardAction(R.id.show_menu, false);
}
});
CriteriaHelper.pollUiThread(new Criteria("App menu was not shown") { CriteriaHelper.pollUiThread(
@Override activity.getAppMenuHandler()::isAppMenuShowing, "App menu was not shown");
public boolean isSatisfied() {
return activity.getAppMenuHandler().isAppMenuShowing();
}
});
} }
} }
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