Commit 159aaa2d authored by Nate Fischer's avatar Nate Fischer Committed by Commit Bot

AW: batch unit tests

This batches a bunch of test suites which seem to obviously be unit
tests (most of these have comments which indicate this, or run in
SINGLE_PROCESS only).

Fixed: 1120843
Test: run_webview_instrumentation_test_apk -A Batch=UnitTests
Change-Id: I801e30f17ac03d1c871c7a079786b993972ceea9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2369616
Commit-Queue: Nate Fischer <ntfschr@chromium.org>
Commit-Queue: Bo <boliu@chromium.org>
Auto-Submit: Nate Fischer <ntfschr@chromium.org>
Reviewed-by: default avatarBo <boliu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#801055}
parent ad3e84ba
......@@ -25,6 +25,7 @@ import org.chromium.android_webview.test.TestAwContentsClient.OnDownloadStartHel
import org.chromium.android_webview.test.TestAwContentsClient.OnLoadResourceHelper;
import org.chromium.android_webview.test.TestAwContentsClient.OnReceivedLoginRequestHelper;
import org.chromium.android_webview.test.TestAwContentsClient.PictureListenerHelper;
import org.chromium.base.test.util.Batch;
import org.chromium.base.test.util.CallbackHelper;
import org.chromium.base.test.util.Feature;
import org.chromium.content_public.browser.test.util.TestCallbackHelperContainer.OnPageStartedHelper;
......@@ -37,6 +38,7 @@ import java.util.concurrent.Callable;
*/
@RunWith(AwJUnit4ClassRunner.class)
@OnlyRunIn(SINGLE_PROCESS) // These are unit tests. No need to repeat for multiprocess.
@Batch(Batch.UNIT_TESTS)
public class AwContentsClientCallbackHelperTest {
@Rule
public AwActivityTestRule mActivityTestRule = new AwActivityTestRule();
......
......@@ -15,6 +15,7 @@ import org.junit.Test;
import org.junit.runner.RunWith;
import org.chromium.android_webview.CleanupReference;
import org.chromium.base.test.util.Batch;
import org.chromium.base.test.util.Feature;
import org.chromium.content_public.browser.test.util.Criteria;
import org.chromium.content_public.browser.test.util.CriteriaHelper;
......@@ -23,7 +24,8 @@ import java.util.concurrent.atomic.AtomicInteger;
/** Test suite for {@link CleanupReference}. */
@RunWith(AwJUnit4ClassRunner.class)
@OnlyRunIn(SINGLE_PROCESS)
@OnlyRunIn(SINGLE_PROCESS) // These are unit tests
@Batch(Batch.UNIT_TESTS)
public class CleanupReferenceTest {
private static AtomicInteger sObjectCount = new AtomicInteger();
......
......@@ -18,6 +18,7 @@ import org.chromium.android_webview.common.crash.CrashInfo;
import org.chromium.android_webview.common.crash.CrashInfo.UploadState;
import org.chromium.android_webview.test.AwJUnit4ClassRunner;
import org.chromium.android_webview.test.OnlyRunIn;
import org.chromium.base.test.util.Batch;
import java.util.HashMap;
import java.util.Map;
......@@ -26,7 +27,8 @@ import java.util.Map;
* Unit tests for CrashInfo.
*/
@RunWith(AwJUnit4ClassRunner.class)
@OnlyRunIn(SINGLE_PROCESS)
@OnlyRunIn(SINGLE_PROCESS) // These are unit tests
@Batch(Batch.UNIT_TESTS)
public class CrashInfoTest {
/**
* Create a {@link CrashInfo} object for testing.
......
......@@ -19,6 +19,7 @@ import org.chromium.android_webview.proto.AwVariationsSeedOuterClass.AwVariation
import org.chromium.android_webview.test.AwJUnit4ClassRunner;
import org.chromium.android_webview.test.OnlyRunIn;
import org.chromium.android_webview.test.util.VariationsTestUtils;
import org.chromium.base.test.util.Batch;
import org.chromium.components.variations.firstrun.VariationsSeedFetcher.SeedInfo;
import java.io.File;
......@@ -30,7 +31,8 @@ import java.util.Arrays;
* Test reading and writing variations seeds.
*/
@RunWith(AwJUnit4ClassRunner.class)
@OnlyRunIn(SINGLE_PROCESS)
@OnlyRunIn(SINGLE_PROCESS) // These are unit tests
@Batch(Batch.UNIT_TESTS)
public class VariationsUtilsTest {
@Test
@MediumTest
......
......@@ -13,6 +13,8 @@ import static androidx.test.espresso.intent.matcher.UriMatchers.hasScheme;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.chromium.android_webview.test.OnlyRunIn.ProcessMode.SINGLE_PROCESS;
import android.content.Intent;
import android.os.Build;
......@@ -24,15 +26,19 @@ import org.junit.runner.RunWith;
import org.chromium.android_webview.common.crash.CrashInfo;
import org.chromium.android_webview.devui.util.CrashBugUrlFactory;
import org.chromium.android_webview.test.AwJUnit4ClassRunner;
import org.chromium.android_webview.test.OnlyRunIn;
import org.chromium.base.test.util.Batch;
import org.chromium.base.test.util.Feature;
import java.util.HashMap;
import java.util.Map;
/**
* Tests for CrashBugUrlFactory class
* Unit tests for CrashBugUrlFactory class
*/
@RunWith(AwJUnit4ClassRunner.class)
@OnlyRunIn(SINGLE_PROCESS) // These are unit tests
@Batch(Batch.UNIT_TESTS)
public class CrashBugUrlFactoryTest {
@Test
@SmallTest
......
......@@ -20,6 +20,7 @@ import org.chromium.android_webview.common.crash.CrashInfo.UploadState;
import org.chromium.android_webview.devui.util.UnuploadedFilesStateLoader;
import org.chromium.android_webview.test.AwJUnit4ClassRunner;
import org.chromium.android_webview.test.OnlyRunIn;
import org.chromium.base.test.util.Batch;
import org.chromium.components.minidump_uploader.CrashFileManager;
import java.io.File;
......@@ -30,7 +31,8 @@ import java.util.List;
* Unit tests for UnuploadedFilesStateLoader.
*/
@RunWith(AwJUnit4ClassRunner.class)
@OnlyRunIn(SINGLE_PROCESS)
@OnlyRunIn(SINGLE_PROCESS) // These are unit tests
@Batch(Batch.UNIT_TESTS)
public class UnuploadedFilesStateLoaderTest {
private static final String LOCAL_ID = "localId1234";
private static final String TEST_FILE_NAME = "test_file-" + LOCAL_ID;
......
......@@ -19,6 +19,7 @@ import org.chromium.android_webview.common.crash.CrashInfo.UploadState;
import org.chromium.android_webview.devui.util.UploadedCrashesInfoLoader;
import org.chromium.android_webview.test.AwJUnit4ClassRunner;
import org.chromium.android_webview.test.OnlyRunIn;
import org.chromium.base.test.util.Batch;
import java.io.BufferedWriter;
import java.io.File;
......@@ -32,7 +33,8 @@ import java.util.concurrent.TimeUnit;
* Unit tests for UploadedCrashesInfoLoader.
*/
@RunWith(AwJUnit4ClassRunner.class)
@OnlyRunIn(SINGLE_PROCESS)
@OnlyRunIn(SINGLE_PROCESS) // These are unit tests
@Batch(Batch.UNIT_TESTS)
public class UploadedCrashesInfoLoaderTest {
private static final String TEST_UPLOAD_TIME_SEC_STR = "1234567890";
private static final long TEST_UPLOAD_TIME_MILLI =
......
......@@ -24,6 +24,7 @@ import org.chromium.android_webview.devui.util.WebViewCrashInfoCollector;
import org.chromium.android_webview.devui.util.WebViewCrashInfoCollector.CrashInfoLoadersFactory;
import org.chromium.android_webview.test.AwJUnit4ClassRunner;
import org.chromium.android_webview.test.OnlyRunIn;
import org.chromium.base.test.util.Batch;
import java.util.Arrays;
import java.util.List;
......@@ -32,7 +33,8 @@ import java.util.List;
* Unit tests for WebViewCrashInfoCollector.
*/
@RunWith(AwJUnit4ClassRunner.class)
@OnlyRunIn(SINGLE_PROCESS)
@OnlyRunIn(SINGLE_PROCESS) // These are unit tests
@Batch(Batch.UNIT_TESTS)
public class WebViewCrashInfoCollectorTest {
private static class CrashInfoLoadersTestFactory extends CrashInfoLoadersFactory {
private final List<CrashInfo> mCrashInfoList;
......
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