Commit de77910b authored by Haiyang Pan's avatar Haiyang Pan Committed by Commit Bot

Revert "Migrate remaining chrome/android native_java_unittest to javatests"

This reverts commit c3907c3e.

Reason for revert: Observed multiple test failures in chrome_pulic_test_apk on android builders, since the following builds:
* https://ci.chromium.org/p/chromium/builders/ci/android-marshmallow-x86-rel/973
* https://ci.chromium.org/p/chromium/builders/ci/android-pie-x86-rel/1894
* https://ci.chromium.org/p/chromium/builders/ci/android-arm64-proguard-rel/2437

Original change's description:
> Migrate remaining chrome/android native_java_unittest to javatests
> 
> native_java_unittests are going away, so these tests need to be migrated
> to javatests.
> 
> Bug: 1103344
> Change-Id: I49a99d1cc1e3170d4af01af8e1a75e9b09249fc5
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2353391
> Commit-Queue: Michael Thiessen <mthiesse@chromium.org>
> Reviewed-by: Yaron Friedman <yfriedman@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#799264}

TBR=yfriedman@chromium.org,mthiesse@chromium.org

Change-Id: Ia64e53afde3d7fdeecb1a4500c74bf6e0ad69ffa
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1103344
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2363925Reviewed-by: default avatarHaiyang Pan <hypan@google.com>
Commit-Queue: Haiyang Pan <hypan@google.com>
Cr-Commit-Position: refs/heads/master@{#799411}
parent 9881e6cd
...@@ -948,6 +948,7 @@ android_library("chrome_test_java") { ...@@ -948,6 +948,7 @@ android_library("chrome_test_java") {
":browser_java_test_support", ":browser_java_test_support",
":chrome_app_java_resources", ":chrome_app_java_resources",
":chrome_test_util_java", ":chrome_test_util_java",
":native_java_unittests_java",
":partner_location_descriptor_proto_java", ":partner_location_descriptor_proto_java",
"$google_play_services_package:google_play_services_base_java", "$google_play_services_package:google_play_services_base_java",
"$google_play_services_package:google_play_services_basement_java", "$google_play_services_package:google_play_services_basement_java",
...@@ -973,7 +974,6 @@ android_library("chrome_test_java") { ...@@ -973,7 +974,6 @@ android_library("chrome_test_java") {
"//chrome/browser/android/crypto:java", "//chrome/browser/android/crypto:java",
"//chrome/browser/android/lifecycle:java", "//chrome/browser/android/lifecycle:java",
"//chrome/browser/browser_controls/android:java", "//chrome/browser/browser_controls/android:java",
"//chrome/browser/contextmenu:java",
"//chrome/browser/download/android:java", "//chrome/browser/download/android:java",
"//chrome/browser/engagement/android:java", "//chrome/browser/engagement/android:java",
"//chrome/browser/enterprise/util:java", "//chrome/browser/enterprise/util:java",
...@@ -1049,7 +1049,6 @@ android_library("chrome_test_java") { ...@@ -1049,7 +1049,6 @@ android_library("chrome_test_java") {
"//components/download/public/common:public_java", "//components/download/public/common:public_java",
"//components/embedder_support/android:browser_context_java", "//components/embedder_support/android:browser_context_java",
"//components/embedder_support/android:content_view_java", "//components/embedder_support/android:content_view_java",
"//components/embedder_support/android:context_menu_java",
"//components/embedder_support/android:util_java", "//components/embedder_support/android:util_java",
"//components/embedder_support/android:web_contents_delegate_java", "//components/embedder_support/android:web_contents_delegate_java",
"//components/embedder_support/android:web_contents_delegate_javatests", "//components/embedder_support/android:web_contents_delegate_javatests",
...@@ -1087,7 +1086,6 @@ android_library("chrome_test_java") { ...@@ -1087,7 +1086,6 @@ android_library("chrome_test_java") {
"//components/schema_org/common:mojom_java", "//components/schema_org/common:mojom_java",
"//components/search_engines/android:java", "//components/search_engines/android:java",
"//components/security_interstitials/content/android:java", "//components/security_interstitials/content/android:java",
"//components/security_state/content/android:java",
"//components/security_state/core:security_state_enums_java", "//components/security_state/core:security_state_enums_java",
"//components/signin/core/browser:signin_enums_java", "//components/signin/core/browser:signin_enums_java",
"//components/signin/core/browser/android:java", "//components/signin/core/browser/android:java",
...@@ -3205,6 +3203,78 @@ generate_jni("chrome_jni_headers") { ...@@ -3205,6 +3203,78 @@ generate_jni("chrome_jni_headers") {
} }
} }
native_java_unittests_tests = [
"native_java_unittests/src/org/chromium/chrome/browser/contextmenu/ChromeContextMenuPopulatorTest.java",
"native_java_unittests/src/org/chromium/chrome/browser/installedapp/InstalledAppProviderTest.java",
"native_java_unittests/src/org/chromium/chrome/browser/notifications/NotificationPlatformBridgeUnitTest.java",
"native_java_unittests/src/org/chromium/chrome/browser/partnercustomizations/PartnerBrowserCustomizationsUnitTest.java",
"native_java_unittests/src/org/chromium/chrome/browser/payments/AndroidPaymentAppFinderUnitTest.java",
"native_java_unittests/src/org/chromium/chrome/browser/payments/AndroidPaymentAppUnitTest.java",
"native_java_unittests/src/org/chromium/chrome/browser/payments/PaymentManifestVerifierTest.java",
"native_java_unittests/src/org/chromium/chrome/browser/tabmodel/TabPersistentStoreUnitTest.java",
"native_java_unittests/src/org/chromium/chrome/browser/toolbar/ToolbarSecurityIconTest.java",
]
android_library("native_java_unittests_java") {
testonly = true
deps = [
":browser_java_test_support",
":chrome_app_java_resources",
":chrome_test_util_java",
"//base:base_java",
"//base:base_java_test_support",
"//base:jni_java",
"//base/test:test_support_java",
"//chrome/android:chrome_java",
"//chrome/browser/contextmenu:java",
"//chrome/browser/flags:java",
"//chrome/browser/image_fetcher:java",
"//chrome/browser/preferences:java",
"//chrome/browser/profiles/android:java",
"//chrome/browser/tab:java",
"//chrome/browser/tabmodel:java",
"//chrome/browser/ui/android/favicon:java",
"//chrome/browser/util:java",
"//chrome/test/android:chrome_java_test_support",
"//components/embedder_support/android:context_menu_java",
"//components/embedder_support/android:util_java",
"//components/omnibox/browser:browser_java",
"//components/payments/content/android:java",
"//components/payments/mojom:mojom_java",
"//components/query_tiles:java",
"//components/search_engines/android:java",
"//components/security_state/content/android:java",
"//components/security_state/core:security_state_enums_java",
"//content/public/android:content_java",
"//content/public/test/android:android_test_message_pump_support_java",
"//content/public/test/android:content_java_test_support",
"//third_party/android_deps:androidx_collection_collection_java",
"//third_party/android_deps:com_google_code_findbugs_jsr305_java",
"//third_party/blink/public:blink_headers_java",
"//third_party/blink/public/mojom:android_mojo_bindings_java",
"//third_party/hamcrest:hamcrest_java",
"//third_party/junit",
"//third_party/mockito:mockito_java",
"//ui/android:ui_java",
"//ui/android:ui_java_test_support",
"//url:gurl_java",
"//url:origin_java",
"//url/mojom:url_mojom_gurl_java",
]
sources = native_java_unittests_tests
annotation_processor_deps = [ "//base/android/jni_generator:jni_processor" ]
}
# See https://bugs.chromium.org/p/chromium/issues/detail?id=908819 for why we
# can't put 'java' in the name here.
generate_jni("native_j_unittests_jni_headers") {
testonly = true
sources = native_java_unittests_tests
feature_list_file = "//chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java"
}
# Used by android-binary-size trybot to validate expectations. # Used by android-binary-size trybot to validate expectations.
if (_enable_libs_and_assets_verification || _enable_manifest_verification) { if (_enable_libs_and_assets_verification || _enable_manifest_verification) {
group("validate_expectations") { group("validate_expectations") {
......
...@@ -104,7 +104,6 @@ chrome_test_java_sources = [ ...@@ -104,7 +104,6 @@ chrome_test_java_sources = [
"javatests/src/org/chromium/chrome/browser/compositor/overlays/strip/TabStripTest.java", "javatests/src/org/chromium/chrome/browser/compositor/overlays/strip/TabStripTest.java",
"javatests/src/org/chromium/chrome/browser/contacts_picker/ContactDetailsTest.java", "javatests/src/org/chromium/chrome/browser/contacts_picker/ContactDetailsTest.java",
"javatests/src/org/chromium/chrome/browser/contacts_picker/ContactsPickerDialogTest.java", "javatests/src/org/chromium/chrome/browser/contacts_picker/ContactsPickerDialogTest.java",
"javatests/src/org/chromium/chrome/browser/contextmenu/ChromeContextMenuPopulatorTest.java",
"javatests/src/org/chromium/chrome/browser/contextmenu/ContextMenuTest.java", "javatests/src/org/chromium/chrome/browser/contextmenu/ContextMenuTest.java",
"javatests/src/org/chromium/chrome/browser/contextmenu/RevampedContextMenuHeaderViewTest.java", "javatests/src/org/chromium/chrome/browser/contextmenu/RevampedContextMenuHeaderViewTest.java",
"javatests/src/org/chromium/chrome/browser/contextmenu/RevampedContextMenuItemViewTest.java", "javatests/src/org/chromium/chrome/browser/contextmenu/RevampedContextMenuItemViewTest.java",
...@@ -246,7 +245,6 @@ chrome_test_java_sources = [ ...@@ -246,7 +245,6 @@ chrome_test_java_sources = [
"javatests/src/org/chromium/chrome/browser/init/StartupTabPreloaderTest.java", "javatests/src/org/chromium/chrome/browser/init/StartupTabPreloaderTest.java",
"javatests/src/org/chromium/chrome/browser/init/StartupTabPreloaderUnitTest.java", "javatests/src/org/chromium/chrome/browser/init/StartupTabPreloaderUnitTest.java",
"javatests/src/org/chromium/chrome/browser/input/SelectPopupOtherContentViewTest.java", "javatests/src/org/chromium/chrome/browser/input/SelectPopupOtherContentViewTest.java",
"javatests/src/org/chromium/chrome/browser/installedapp/InstalledAppProviderTest.java",
"javatests/src/org/chromium/chrome/browser/instantapps/InstantAppsHandlerTest.java", "javatests/src/org/chromium/chrome/browser/instantapps/InstantAppsHandlerTest.java",
"javatests/src/org/chromium/chrome/browser/interstitials/LookalikeInterstitialTest.java", "javatests/src/org/chromium/chrome/browser/interstitials/LookalikeInterstitialTest.java",
"javatests/src/org/chromium/chrome/browser/jsdialog/JavascriptAppModalDialogTest.java", "javatests/src/org/chromium/chrome/browser/jsdialog/JavascriptAppModalDialogTest.java",
...@@ -277,7 +275,6 @@ chrome_test_java_sources = [ ...@@ -277,7 +275,6 @@ chrome_test_java_sources = [
"javatests/src/org/chromium/chrome/browser/notifications/NotificationBuilderBaseTest.java", "javatests/src/org/chromium/chrome/browser/notifications/NotificationBuilderBaseTest.java",
"javatests/src/org/chromium/chrome/browser/notifications/NotificationPlatformBridgeIntentTest.java", "javatests/src/org/chromium/chrome/browser/notifications/NotificationPlatformBridgeIntentTest.java",
"javatests/src/org/chromium/chrome/browser/notifications/NotificationPlatformBridgeTest.java", "javatests/src/org/chromium/chrome/browser/notifications/NotificationPlatformBridgeTest.java",
"javatests/src/org/chromium/chrome/browser/notifications/NotificationPlatformBridgeUnitTest.java",
"javatests/src/org/chromium/chrome/browser/notifications/NotificationTestRule.java", "javatests/src/org/chromium/chrome/browser/notifications/NotificationTestRule.java",
"javatests/src/org/chromium/chrome/browser/notifications/NotificationTestUtil.java", "javatests/src/org/chromium/chrome/browser/notifications/NotificationTestUtil.java",
"javatests/src/org/chromium/chrome/browser/notifications/NotificationWrapperBuilderFactoryTest.java", "javatests/src/org/chromium/chrome/browser/notifications/NotificationWrapperBuilderFactoryTest.java",
...@@ -347,7 +344,6 @@ chrome_test_java_sources = [ ...@@ -347,7 +344,6 @@ chrome_test_java_sources = [
"javatests/src/org/chromium/chrome/browser/paint_preview/services/PaintPreviewTabServiceTest.java", "javatests/src/org/chromium/chrome/browser/paint_preview/services/PaintPreviewTabServiceTest.java",
"javatests/src/org/chromium/chrome/browser/partnercustomizations/BasePartnerBrowserCustomizationIntegrationTestRule.java", "javatests/src/org/chromium/chrome/browser/partnercustomizations/BasePartnerBrowserCustomizationIntegrationTestRule.java",
"javatests/src/org/chromium/chrome/browser/partnercustomizations/BasePartnerBrowserCustomizationUnitTestRule.java", "javatests/src/org/chromium/chrome/browser/partnercustomizations/BasePartnerBrowserCustomizationUnitTestRule.java",
"javatests/src/org/chromium/chrome/browser/partnercustomizations/PartnerBrowserCustomizationsUnitTest.java",
"javatests/src/org/chromium/chrome/browser/partnercustomizations/PartnerDisableBookmarksEditingUnitTest.java", "javatests/src/org/chromium/chrome/browser/partnercustomizations/PartnerDisableBookmarksEditingUnitTest.java",
"javatests/src/org/chromium/chrome/browser/partnercustomizations/PartnerDisableIncognitoModeIntegrationTest.java", "javatests/src/org/chromium/chrome/browser/partnercustomizations/PartnerDisableIncognitoModeIntegrationTest.java",
"javatests/src/org/chromium/chrome/browser/partnercustomizations/PartnerDisableIncognitoModeUnitTest.java", "javatests/src/org/chromium/chrome/browser/partnercustomizations/PartnerDisableIncognitoModeUnitTest.java",
...@@ -359,8 +355,6 @@ chrome_test_java_sources = [ ...@@ -359,8 +355,6 @@ chrome_test_java_sources = [
"javatests/src/org/chromium/chrome/browser/password_manager/settings/PasswordSettingsTest.java", "javatests/src/org/chromium/chrome/browser/password_manager/settings/PasswordSettingsTest.java",
"javatests/src/org/chromium/chrome/browser/password_manager/settings/PasswordViewingTypeTest.java", "javatests/src/org/chromium/chrome/browser/password_manager/settings/PasswordViewingTypeTest.java",
"javatests/src/org/chromium/chrome/browser/payments/AndroidPaymentAppFinderTest.java", "javatests/src/org/chromium/chrome/browser/payments/AndroidPaymentAppFinderTest.java",
"javatests/src/org/chromium/chrome/browser/payments/AndroidPaymentAppFinderUnitTest.java",
"javatests/src/org/chromium/chrome/browser/payments/AndroidPaymentAppUnitTest.java",
"javatests/src/org/chromium/chrome/browser/payments/CurrencyFormatterTest.java", "javatests/src/org/chromium/chrome/browser/payments/CurrencyFormatterTest.java",
"javatests/src/org/chromium/chrome/browser/payments/ExpandablePaymentHandlerChangePaymentMethodTest.java", "javatests/src/org/chromium/chrome/browser/payments/ExpandablePaymentHandlerChangePaymentMethodTest.java",
"javatests/src/org/chromium/chrome/browser/payments/ExpandablePaymentHandlerTest.java", "javatests/src/org/chromium/chrome/browser/payments/ExpandablePaymentHandlerTest.java",
...@@ -374,7 +368,6 @@ chrome_test_java_sources = [ ...@@ -374,7 +368,6 @@ chrome_test_java_sources = [
"javatests/src/org/chromium/chrome/browser/payments/PaymentHandlerEnableDelegationsTest.java", "javatests/src/org/chromium/chrome/browser/payments/PaymentHandlerEnableDelegationsTest.java",
"javatests/src/org/chromium/chrome/browser/payments/PaymentManifestDownloaderTest.java", "javatests/src/org/chromium/chrome/browser/payments/PaymentManifestDownloaderTest.java",
"javatests/src/org/chromium/chrome/browser/payments/PaymentManifestParserTest.java", "javatests/src/org/chromium/chrome/browser/payments/PaymentManifestParserTest.java",
"javatests/src/org/chromium/chrome/browser/payments/PaymentManifestVerifierTest.java",
"javatests/src/org/chromium/chrome/browser/payments/PaymentRequestAbortTest.java", "javatests/src/org/chromium/chrome/browser/payments/PaymentRequestAbortTest.java",
"javatests/src/org/chromium/chrome/browser/payments/PaymentRequestBillingAddressTest.java", "javatests/src/org/chromium/chrome/browser/payments/PaymentRequestBillingAddressTest.java",
"javatests/src/org/chromium/chrome/browser/payments/PaymentRequestBillingAddressWithoutPhoneTest.java", "javatests/src/org/chromium/chrome/browser/payments/PaymentRequestBillingAddressWithoutPhoneTest.java",
...@@ -563,7 +556,6 @@ chrome_test_java_sources = [ ...@@ -563,7 +556,6 @@ chrome_test_java_sources = [
"javatests/src/org/chromium/chrome/browser/tabmodel/TabModelSelectorTabModelObserverTest.java", "javatests/src/org/chromium/chrome/browser/tabmodel/TabModelSelectorTabModelObserverTest.java",
"javatests/src/org/chromium/chrome/browser/tabmodel/TabModelSelectorTabObserverTest.java", "javatests/src/org/chromium/chrome/browser/tabmodel/TabModelSelectorTabObserverTest.java",
"javatests/src/org/chromium/chrome/browser/tabmodel/TabPersistentStoreTest.java", "javatests/src/org/chromium/chrome/browser/tabmodel/TabPersistentStoreTest.java",
"javatests/src/org/chromium/chrome/browser/tabmodel/TabPersistentStoreUnitTest.java",
"javatests/src/org/chromium/chrome/browser/tabmodel/TabWindowManagerTest.java", "javatests/src/org/chromium/chrome/browser/tabmodel/TabWindowManagerTest.java",
"javatests/src/org/chromium/chrome/browser/tabmodel/TestTabModelDirectory.java", "javatests/src/org/chromium/chrome/browser/tabmodel/TestTabModelDirectory.java",
"javatests/src/org/chromium/chrome/browser/tabmodel/UndoTabModelTest.java", "javatests/src/org/chromium/chrome/browser/tabmodel/UndoTabModelTest.java",
...@@ -574,7 +566,6 @@ chrome_test_java_sources = [ ...@@ -574,7 +566,6 @@ chrome_test_java_sources = [
"javatests/src/org/chromium/chrome/browser/toolbar/LocationBarModelTest.java", "javatests/src/org/chromium/chrome/browser/toolbar/LocationBarModelTest.java",
"javatests/src/org/chromium/chrome/browser/toolbar/ToolbarProgressBarIntegrationTest.java", "javatests/src/org/chromium/chrome/browser/toolbar/ToolbarProgressBarIntegrationTest.java",
"javatests/src/org/chromium/chrome/browser/toolbar/ToolbarProgressBarTest.java", "javatests/src/org/chromium/chrome/browser/toolbar/ToolbarProgressBarTest.java",
"javatests/src/org/chromium/chrome/browser/toolbar/ToolbarSecurityIconTest.java",
"javatests/src/org/chromium/chrome/browser/toolbar/ToolbarTest.java", "javatests/src/org/chromium/chrome/browser/toolbar/ToolbarTest.java",
"javatests/src/org/chromium/chrome/browser/toolbar/bottom/BottomToolbarTest.java", "javatests/src/org/chromium/chrome/browser/toolbar/bottom/BottomToolbarTest.java",
"javatests/src/org/chromium/chrome/browser/toolbar/bottom/BottomToolbarWithStartSurfaceTest.java", "javatests/src/org/chromium/chrome/browser/toolbar/bottom/BottomToolbarWithStartSurfaceTest.java",
......
...@@ -37,7 +37,6 @@ include_rules = [ ...@@ -37,7 +37,6 @@ include_rules = [
"+components/permissions/android/java/src/org/chromium/components/permissions", "+components/permissions/android/java/src/org/chromium/components/permissions",
"+components/safe_browsing/android/java/src/org/chromium/components/safe_browsing", "+components/safe_browsing/android/java/src/org/chromium/components/safe_browsing",
"+components/search_engines", "+components/search_engines",
"+components/security_state/content/android/java",
"+components/sync/android/java/src/org/chromium/components/sync", "+components/sync/android/java/src/org/chromium/components/sync",
"+components/sync/test/fake_server/android", "+components/sync/test/fake_server/android",
# We should only depend on the util package of something that lives in # We should only depend on the util package of something that lives in
......
...@@ -11,19 +11,13 @@ import static org.mockito.Mockito.when; ...@@ -11,19 +11,13 @@ import static org.mockito.Mockito.when;
import android.util.Pair; import android.util.Pair;
import androidx.test.filters.SmallTest;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock; import org.mockito.Mock;
import org.mockito.Mockito; import org.mockito.Mockito;
import org.mockito.MockitoAnnotations; import org.mockito.MockitoAnnotations;
import org.chromium.base.ContextUtils; import org.chromium.base.ContextUtils;
import org.chromium.base.test.BaseJUnit4ClassRunner; import org.chromium.base.annotations.CalledByNative;
import org.chromium.base.test.UiThreadTest; import org.chromium.base.annotations.CalledByNativeJavaTest;
import org.chromium.base.test.util.Batch;
import org.chromium.blink_public.common.ContextMenuDataMediaType; import org.chromium.blink_public.common.ContextMenuDataMediaType;
import org.chromium.chrome.R; import org.chromium.chrome.R;
import org.chromium.chrome.browser.IntentHandler; import org.chromium.chrome.browser.IntentHandler;
...@@ -34,7 +28,6 @@ import org.chromium.chrome.browser.flags.ChromeFeatureList; ...@@ -34,7 +28,6 @@ import org.chromium.chrome.browser.flags.ChromeFeatureList;
import org.chromium.chrome.browser.share.ShareDelegate; import org.chromium.chrome.browser.share.ShareDelegate;
import org.chromium.components.embedder_support.contextmenu.ContextMenuParams; import org.chromium.components.embedder_support.contextmenu.ContextMenuParams;
import org.chromium.components.search_engines.TemplateUrlService; import org.chromium.components.search_engines.TemplateUrlService;
import org.chromium.content_public.browser.test.NativeLibraryTestUtils;
import org.chromium.ui.base.MenuSourceType; import org.chromium.ui.base.MenuSourceType;
import java.util.Arrays; import java.util.Arrays;
...@@ -44,8 +37,6 @@ import java.util.List; ...@@ -44,8 +37,6 @@ import java.util.List;
/** /**
* Unit tests for the context menu logic of Chrome. * Unit tests for the context menu logic of Chrome.
*/ */
@RunWith(BaseJUnit4ClassRunner.class)
@Batch(Batch.UNIT_TESTS)
public class ChromeContextMenuPopulatorTest { public class ChromeContextMenuPopulatorTest {
private static final String PAGE_URL = "http://www.blah.com"; private static final String PAGE_URL = "http://www.blah.com";
private static final String LINK_URL = "http://www.blah.com/other_blah"; private static final String LINK_URL = "http://www.blah.com/other_blah";
...@@ -64,12 +55,13 @@ public class ChromeContextMenuPopulatorTest { ...@@ -64,12 +55,13 @@ public class ChromeContextMenuPopulatorTest {
private ChromeContextMenuPopulator mPopulator; private ChromeContextMenuPopulator mPopulator;
@Before @CalledByNative
private ChromeContextMenuPopulatorTest() {}
@CalledByNative
public void setUp() { public void setUp() {
MockitoAnnotations.initMocks(this); MockitoAnnotations.initMocks(this);
NativeLibraryTestUtils.loadNativeLibraryNoBrowserProcess();
when(mItemDelegate.getPageUrl()).thenReturn(PAGE_URL); when(mItemDelegate.getPageUrl()).thenReturn(PAGE_URL);
when(mItemDelegate.isIncognitoSupported()).thenReturn(true); when(mItemDelegate.isIncognitoSupported()).thenReturn(true);
when(mItemDelegate.isOpenInOtherWindowSupported()).thenReturn(true); when(mItemDelegate.isOpenInOtherWindowSupported()).thenReturn(true);
...@@ -122,9 +114,7 @@ public class ChromeContextMenuPopulatorTest { ...@@ -122,9 +114,7 @@ public class ChromeContextMenuPopulatorTest {
} }
} }
@Test @CalledByNativeJavaTest
@SmallTest
@UiThreadTest
public void testHttpLink() { public void testHttpLink() {
FirstRunStatus.setFirstRunFlowComplete(false); FirstRunStatus.setFirstRunFlowComplete(false);
ContextMenuParams contextMenuParams = new ContextMenuParams(0, 0, PAGE_URL, LINK_URL, ContextMenuParams contextMenuParams = new ContextMenuParams(0, 0, PAGE_URL, LINK_URL,
...@@ -161,9 +151,7 @@ public class ChromeContextMenuPopulatorTest { ...@@ -161,9 +151,7 @@ public class ChromeContextMenuPopulatorTest {
checkMenuOptions(contextMenuParams, expected4); checkMenuOptions(contextMenuParams, expected4);
} }
@Test @CalledByNativeJavaTest
@SmallTest
@UiThreadTest
public void testHttpLinkWithPreviewTabEnabled() { public void testHttpLinkWithPreviewTabEnabled() {
ContextMenuParams contextMenuParams = new ContextMenuParams(0, 0, PAGE_URL, LINK_URL, ContextMenuParams contextMenuParams = new ContextMenuParams(0, 0, PAGE_URL, LINK_URL,
LINK_TEXT, "", "", "", null, false, 0, 0, MenuSourceType.MENU_SOURCE_TOUCH); LINK_TEXT, "", "", "", null, false, 0, 0, MenuSourceType.MENU_SOURCE_TOUCH);
...@@ -196,9 +184,7 @@ public class ChromeContextMenuPopulatorTest { ...@@ -196,9 +184,7 @@ public class ChromeContextMenuPopulatorTest {
checkMenuOptions(contextMenuParams, expected3); checkMenuOptions(contextMenuParams, expected3);
} }
@Test @CalledByNativeJavaTest
@SmallTest
@UiThreadTest
public void testMailLink() { public void testMailLink() {
FirstRunStatus.setFirstRunFlowComplete(false); FirstRunStatus.setFirstRunFlowComplete(false);
ContextMenuParams contextMenuParams = ContextMenuParams contextMenuParams =
...@@ -234,9 +220,7 @@ public class ChromeContextMenuPopulatorTest { ...@@ -234,9 +220,7 @@ public class ChromeContextMenuPopulatorTest {
checkMenuOptions(contextMenuParams, expected4); checkMenuOptions(contextMenuParams, expected4);
} }
@Test @CalledByNativeJavaTest
@SmallTest
@UiThreadTest
public void testTelLink() { public void testTelLink() {
FirstRunStatus.setFirstRunFlowComplete(false); FirstRunStatus.setFirstRunFlowComplete(false);
ContextMenuParams contextMenuParams = ContextMenuParams contextMenuParams =
...@@ -273,9 +257,7 @@ public class ChromeContextMenuPopulatorTest { ...@@ -273,9 +257,7 @@ public class ChromeContextMenuPopulatorTest {
checkMenuOptions(contextMenuParams, expected4); checkMenuOptions(contextMenuParams, expected4);
} }
@Test @CalledByNativeJavaTest
@SmallTest
@UiThreadTest
public void testVideoLink() { public void testVideoLink() {
FirstRunStatus.setFirstRunFlowComplete(false); FirstRunStatus.setFirstRunFlowComplete(false);
String sourceUrl = "http://www.blah.com/"; String sourceUrl = "http://www.blah.com/";
...@@ -316,9 +298,7 @@ public class ChromeContextMenuPopulatorTest { ...@@ -316,9 +298,7 @@ public class ChromeContextMenuPopulatorTest {
checkMenuOptions(contextMenuParams, expected4Tab1, expected4Tab2); checkMenuOptions(contextMenuParams, expected4Tab1, expected4Tab2);
} }
@Test @CalledByNativeJavaTest
@SmallTest
@UiThreadTest
public void testImageHiFi() { public void testImageHiFi() {
FirstRunStatus.setFirstRunFlowComplete(false); FirstRunStatus.setFirstRunFlowComplete(false);
ContextMenuParams contextMenuParams = new ContextMenuParams(0, ContextMenuParams contextMenuParams = new ContextMenuParams(0,
...@@ -353,9 +333,7 @@ public class ChromeContextMenuPopulatorTest { ...@@ -353,9 +333,7 @@ public class ChromeContextMenuPopulatorTest {
checkMenuOptions(contextMenuParams, expected4); checkMenuOptions(contextMenuParams, expected4);
} }
@Test @CalledByNativeJavaTest
@SmallTest
@UiThreadTest
public void testHttpLinkWithImageHiFi() { public void testHttpLinkWithImageHiFi() {
FirstRunStatus.setFirstRunFlowComplete(false); FirstRunStatus.setFirstRunFlowComplete(false);
ContextMenuParams contextMenuParams = new ContextMenuParams(0, ContextMenuParams contextMenuParams = new ContextMenuParams(0,
......
...@@ -12,23 +12,14 @@ import android.content.res.Resources; ...@@ -12,23 +12,14 @@ import android.content.res.Resources;
import android.os.Bundle; import android.os.Bundle;
import android.util.Pair; import android.util.Pair;
import androidx.test.filters.SmallTest;
import org.junit.Assert; import org.junit.Assert;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.chromium.base.Callback; import org.chromium.base.Callback;
import org.chromium.base.test.BaseJUnit4ClassRunner; import org.chromium.base.annotations.CalledByNative;
import org.chromium.base.test.UiThreadTest; import org.chromium.base.annotations.CalledByNativeJavaTest;
import org.chromium.base.test.util.Batch; import org.chromium.base.annotations.DisabledCalledByNativeJavaTest;
import org.chromium.base.test.util.DisabledTest;
import org.chromium.base.test.util.JniMocker;
import org.chromium.chrome.browser.instantapps.InstantAppsHandler; import org.chromium.chrome.browser.instantapps.InstantAppsHandler;
import org.chromium.chrome.browser.profiles.Profile; import org.chromium.chrome.browser.profiles.Profile;
import org.chromium.content_public.browser.test.NativeLibraryTestUtils;
import org.chromium.content_public.browser.test.util.CriteriaHelper; import org.chromium.content_public.browser.test.util.CriteriaHelper;
import org.chromium.installedapp.mojom.InstalledAppProvider; import org.chromium.installedapp.mojom.InstalledAppProvider;
import org.chromium.installedapp.mojom.RelatedApplication; import org.chromium.installedapp.mojom.RelatedApplication;
...@@ -44,8 +35,6 @@ import java.util.Set; ...@@ -44,8 +35,6 @@ import java.util.Set;
import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicBoolean;
/** Ensure that the InstalledAppProvider returns the correct apps. */ /** Ensure that the InstalledAppProvider returns the correct apps. */
@RunWith(BaseJUnit4ClassRunner.class)
@Batch(Batch.UNIT_TESTS)
public class InstalledAppProviderTest { public class InstalledAppProviderTest {
private static final String ASSET_STATEMENTS_KEY = private static final String ASSET_STATEMENTS_KEY =
InstalledAppProviderImpl.ASSET_STATEMENTS_KEY; InstalledAppProviderImpl.ASSET_STATEMENTS_KEY;
...@@ -79,9 +68,6 @@ public class InstalledAppProviderTest { ...@@ -79,9 +68,6 @@ public class InstalledAppProviderTest {
private static final String ORIGIN_DIFFERENT_HOST = "https://example.org:8000"; private static final String ORIGIN_DIFFERENT_HOST = "https://example.org:8000";
private static final String ORIGIN_DIFFERENT_PORT = "https://example.com:8001"; private static final String ORIGIN_DIFFERENT_PORT = "https://example.com:8001";
@Rule
public JniMocker mocker = new JniMocker();
private FakePackageManager mFakePackageManager; private FakePackageManager mFakePackageManager;
private FakeFrameUrlDelegate mFrameUrlDelegate; private FakeFrameUrlDelegate mFrameUrlDelegate;
private InstalledAppProviderTestImpl mInstalledAppProvider; private InstalledAppProviderTestImpl mInstalledAppProvider;
...@@ -389,12 +375,14 @@ public class InstalledAppProviderTest { ...@@ -389,12 +375,14 @@ public class InstalledAppProviderTest {
CriteriaHelper.pollUiThreadNested(() -> called.get()); CriteriaHelper.pollUiThreadNested(() -> called.get());
} }
@Before @CalledByNative
public void setUp() throws Exception { private InstalledAppProviderTest() {}
NativeLibraryTestUtils.loadNativeLibraryNoBrowserProcess();
@CalledByNative
public void setUp() throws Exception {
mTestInstalledAppProviderImplJni = new TestInstalledAppProviderImplJni(); mTestInstalledAppProviderImplJni = new TestInstalledAppProviderImplJni();
mocker.mock(InstalledAppProviderImplJni.TEST_HOOKS, mTestInstalledAppProviderImplJni); InstalledAppProviderImplJni.TEST_HOOKS.setInstanceForTesting(
mTestInstalledAppProviderImplJni);
mFakePackageManager = new FakePackageManager(); mFakePackageManager = new FakePackageManager();
mFrameUrlDelegate = new FakeFrameUrlDelegate(URL_ON_ORIGIN); mFrameUrlDelegate = new FakeFrameUrlDelegate(URL_ON_ORIGIN);
...@@ -403,10 +391,13 @@ public class InstalledAppProviderTest { ...@@ -403,10 +391,13 @@ public class InstalledAppProviderTest {
mFrameUrlDelegate, mFakePackageManager, mFakeInstantAppsHandler); mFrameUrlDelegate, mFakePackageManager, mFakeInstantAppsHandler);
} }
@CalledByNative
public void tearDown() throws Exception {
InstalledAppProviderImplJni.TEST_HOOKS.setInstanceForTesting(null);
}
/** Origin of the page using the API is missing certain parts of the URI. */ /** Origin of the page using the API is missing certain parts of the URI. */
@Test @CalledByNativeJavaTest
@SmallTest
@UiThreadTest
public void testOriginMissingParts() throws Exception { public void testOriginMissingParts() throws Exception {
RelatedApplication manifestRelatedApps[] = new RelatedApplication[] { RelatedApplication manifestRelatedApps[] = new RelatedApplication[] {
createRelatedApplication(PLATFORM_ANDROID, PACKAGE_NAME_1, null)}; createRelatedApplication(PLATFORM_ANDROID, PACKAGE_NAME_1, null)};
...@@ -421,9 +412,7 @@ public class InstalledAppProviderTest { ...@@ -421,9 +412,7 @@ public class InstalledAppProviderTest {
} }
/** Incognito mode with one related Android app. */ /** Incognito mode with one related Android app. */
@Test @CalledByNativeJavaTest
@SmallTest
@UiThreadTest
public void testIncognitoWithOneInstalledRelatedApp() throws Exception { public void testIncognitoWithOneInstalledRelatedApp() throws Exception {
RelatedApplication manifestRelatedApps[] = new RelatedApplication[] { RelatedApplication manifestRelatedApps[] = new RelatedApplication[] {
createRelatedApplication(PLATFORM_ANDROID, PACKAGE_NAME_1, null)}; createRelatedApplication(PLATFORM_ANDROID, PACKAGE_NAME_1, null)};
...@@ -439,9 +428,7 @@ public class InstalledAppProviderTest { ...@@ -439,9 +428,7 @@ public class InstalledAppProviderTest {
* *
* <p>An Android app relates to the web app, but not mutual. * <p>An Android app relates to the web app, but not mutual.
*/ */
@Test @CalledByNativeJavaTest
@SmallTest
@UiThreadTest
public void testNoRelatedApps() throws Exception { public void testNoRelatedApps() throws Exception {
// The web manifest has no related apps. // The web manifest has no related apps.
RelatedApplication manifestRelatedApps[] = new RelatedApplication[] {}; RelatedApplication manifestRelatedApps[] = new RelatedApplication[] {};
...@@ -459,9 +446,7 @@ public class InstalledAppProviderTest { ...@@ -459,9 +446,7 @@ public class InstalledAppProviderTest {
* *
* <p>An Android app relates to the web app, but not mutual. * <p>An Android app relates to the web app, but not mutual.
*/ */
@Test @CalledByNativeJavaTest
@SmallTest
@UiThreadTest
public void testOneRelatedAppNoId() throws Exception { public void testOneRelatedAppNoId() throws Exception {
RelatedApplication manifestRelatedApps[] = RelatedApplication manifestRelatedApps[] =
new RelatedApplication[] {createRelatedApplication(PLATFORM_ANDROID, null, null)}; new RelatedApplication[] {createRelatedApplication(PLATFORM_ANDROID, null, null)};
...@@ -478,9 +463,7 @@ public class InstalledAppProviderTest { ...@@ -478,9 +463,7 @@ public class InstalledAppProviderTest {
* <p>An Android app with the same id relates to the web app. This should be ignored since the * <p>An Android app with the same id relates to the web app. This should be ignored since the
* manifest doesn't mention the Android app. * manifest doesn't mention the Android app.
*/ */
@Test @CalledByNativeJavaTest
@SmallTest
@UiThreadTest
public void testOneRelatedNonAndroidApp() throws Exception { public void testOneRelatedNonAndroidApp() throws Exception {
RelatedApplication manifestRelatedApps[] = new RelatedApplication[] { RelatedApplication manifestRelatedApps[] = new RelatedApplication[] {
createRelatedApplication(PLATFORM_OTHER, PACKAGE_NAME_1, null)}; createRelatedApplication(PLATFORM_OTHER, PACKAGE_NAME_1, null)};
...@@ -496,9 +479,7 @@ public class InstalledAppProviderTest { ...@@ -496,9 +479,7 @@ public class InstalledAppProviderTest {
* *
* <p>Another Android app relates to the web app, but not mutual. * <p>Another Android app relates to the web app, but not mutual.
*/ */
@Test @CalledByNativeJavaTest
@SmallTest
@UiThreadTest
public void testOneRelatedAppNotInstalled() throws Exception { public void testOneRelatedAppNotInstalled() throws Exception {
// The web manifest has a related Android app named |PACKAGE_NAME_1|. // The web manifest has a related Android app named |PACKAGE_NAME_1|.
RelatedApplication manifestRelatedApps[] = new RelatedApplication[] { RelatedApplication manifestRelatedApps[] = new RelatedApplication[] {
...@@ -515,9 +496,7 @@ public class InstalledAppProviderTest { ...@@ -515,9 +496,7 @@ public class InstalledAppProviderTest {
/** /**
* Android app manifest has an asset_statements key, but the resource it links to is missing. * Android app manifest has an asset_statements key, but the resource it links to is missing.
*/ */
@Test @CalledByNativeJavaTest
@SmallTest
@UiThreadTest
public void testOneRelatedAppBrokenAssetStatementsResource() throws Exception { public void testOneRelatedAppBrokenAssetStatementsResource() throws Exception {
RelatedApplication manifestRelatedApps[] = new RelatedApplication[] { RelatedApplication manifestRelatedApps[] = new RelatedApplication[] {
createRelatedApplication(PLATFORM_ANDROID, PACKAGE_NAME_1, null)}; createRelatedApplication(PLATFORM_ANDROID, PACKAGE_NAME_1, null)};
...@@ -532,9 +511,7 @@ public class InstalledAppProviderTest { ...@@ -532,9 +511,7 @@ public class InstalledAppProviderTest {
} }
/** One related Android app; Android app is not mutually related (has no asset_statements). */ /** One related Android app; Android app is not mutually related (has no asset_statements). */
@Test @CalledByNativeJavaTest
@SmallTest
@UiThreadTest
public void testOneRelatedAppNoAssetStatements() throws Exception { public void testOneRelatedAppNoAssetStatements() throws Exception {
RelatedApplication manifestRelatedApps[] = new RelatedApplication[] { RelatedApplication manifestRelatedApps[] = new RelatedApplication[] {
createRelatedApplication(PLATFORM_ANDROID, PACKAGE_NAME_1, null)}; createRelatedApplication(PLATFORM_ANDROID, PACKAGE_NAME_1, null)};
...@@ -545,9 +522,7 @@ public class InstalledAppProviderTest { ...@@ -545,9 +522,7 @@ public class InstalledAppProviderTest {
} }
/** One related Android app; Android app is not mutually related (has no asset_statements). */ /** One related Android app; Android app is not mutually related (has no asset_statements). */
@Test @CalledByNativeJavaTest
@SmallTest
@UiThreadTest
public void testOneRelatedAppNoAssetStatementsNullMetadata() throws Exception { public void testOneRelatedAppNoAssetStatementsNullMetadata() throws Exception {
RelatedApplication manifestRelatedApps[] = new RelatedApplication[] { RelatedApplication manifestRelatedApps[] = new RelatedApplication[] {
createRelatedApplication(PLATFORM_ANDROID, PACKAGE_NAME_1, null)}; createRelatedApplication(PLATFORM_ANDROID, PACKAGE_NAME_1, null)};
...@@ -565,9 +540,7 @@ public class InstalledAppProviderTest { ...@@ -565,9 +540,7 @@ public class InstalledAppProviderTest {
* The Android app is related to a web app with a different host. - The Android app is related * The Android app is related to a web app with a different host. - The Android app is related
* to a web app with a different port. * to a web app with a different port.
*/ */
@Test @CalledByNativeJavaTest
@SmallTest
@UiThreadTest
public void testOneRelatedAppRelatedToDifferentOrigins() throws Exception { public void testOneRelatedAppRelatedToDifferentOrigins() throws Exception {
RelatedApplication manifestRelatedApps[] = new RelatedApplication[] { RelatedApplication manifestRelatedApps[] = new RelatedApplication[] {
createRelatedApplication(PLATFORM_ANDROID, PACKAGE_NAME_1, null)}; createRelatedApplication(PLATFORM_ANDROID, PACKAGE_NAME_1, null)};
...@@ -587,9 +560,7 @@ public class InstalledAppProviderTest { ...@@ -587,9 +560,7 @@ public class InstalledAppProviderTest {
} }
/** One related Android app; Android app is installed and mutually related. */ /** One related Android app; Android app is installed and mutually related. */
@Test @CalledByNativeJavaTest
@SmallTest
@UiThreadTest
public void testOneInstalledRelatedApp() throws Exception { public void testOneInstalledRelatedApp() throws Exception {
RelatedApplication manifestRelatedApps[] = new RelatedApplication[] { RelatedApplication manifestRelatedApps[] = new RelatedApplication[] {
createRelatedApplication(PLATFORM_ANDROID, PACKAGE_NAME_1, null)}; createRelatedApplication(PLATFORM_ANDROID, PACKAGE_NAME_1, null)};
...@@ -605,9 +576,7 @@ public class InstalledAppProviderTest { ...@@ -605,9 +576,7 @@ public class InstalledAppProviderTest {
* *
* <p>This simulates navigating the frame while keeping the same Mojo service open. * <p>This simulates navigating the frame while keeping the same Mojo service open.
*/ */
@Test @CalledByNativeJavaTest
@SmallTest
@UiThreadTest
public void testDynamicallyChangingUrl() throws Exception { public void testDynamicallyChangingUrl() throws Exception {
RelatedApplication manifestRelatedApps[] = new RelatedApplication[] { RelatedApplication manifestRelatedApps[] = new RelatedApplication[] {
createRelatedApplication(PLATFORM_ANDROID, PACKAGE_NAME_1, null)}; createRelatedApplication(PLATFORM_ANDROID, PACKAGE_NAME_1, null)};
...@@ -634,9 +603,7 @@ public class InstalledAppProviderTest { ...@@ -634,9 +603,7 @@ public class InstalledAppProviderTest {
} }
/** One related Android app (installed and mutually related), with a non-null URL field. */ /** One related Android app (installed and mutually related), with a non-null URL field. */
@Test @CalledByNativeJavaTest
@SmallTest
@UiThreadTest
public void testInstalledRelatedAppWithUrl() throws Exception { public void testInstalledRelatedAppWithUrl() throws Exception {
RelatedApplication manifestRelatedApps[] = new RelatedApplication[] { RelatedApplication manifestRelatedApps[] = new RelatedApplication[] {
createRelatedApplication(PLATFORM_ANDROID, PACKAGE_NAME_1, URL_UNRELATED)}; createRelatedApplication(PLATFORM_ANDROID, PACKAGE_NAME_1, URL_UNRELATED)};
...@@ -648,9 +615,7 @@ public class InstalledAppProviderTest { ...@@ -648,9 +615,7 @@ public class InstalledAppProviderTest {
} }
/** One related Android app; Android app is related to multiple origins. */ /** One related Android app; Android app is related to multiple origins. */
@Test @CalledByNativeJavaTest
@SmallTest
@UiThreadTest
public void testMultipleAssetStatements() throws Exception { public void testMultipleAssetStatements() throws Exception {
RelatedApplication manifestRelatedApps[] = new RelatedApplication[] { RelatedApplication manifestRelatedApps[] = new RelatedApplication[] {
createRelatedApplication(PLATFORM_ANDROID, PACKAGE_NAME_1, null)}; createRelatedApplication(PLATFORM_ANDROID, PACKAGE_NAME_1, null)};
...@@ -669,9 +634,7 @@ public class InstalledAppProviderTest { ...@@ -669,9 +634,7 @@ public class InstalledAppProviderTest {
} }
/** A JSON syntax error in the Android app's asset statement. */ /** A JSON syntax error in the Android app's asset statement. */
@Test @CalledByNativeJavaTest
@SmallTest
@UiThreadTest
public void testAssetStatementSyntaxError() throws Exception { public void testAssetStatementSyntaxError() throws Exception {
RelatedApplication manifestRelatedApps[] = new RelatedApplication[] { RelatedApplication manifestRelatedApps[] = new RelatedApplication[] {
createRelatedApplication(PLATFORM_ANDROID, PACKAGE_NAME_1, null)}; createRelatedApplication(PLATFORM_ANDROID, PACKAGE_NAME_1, null)};
...@@ -684,9 +647,7 @@ public class InstalledAppProviderTest { ...@@ -684,9 +647,7 @@ public class InstalledAppProviderTest {
} }
/** The Android app's asset statement is not an array. */ /** The Android app's asset statement is not an array. */
@Test @CalledByNativeJavaTest
@SmallTest
@UiThreadTest
public void testAssetStatementNotArray() throws Exception { public void testAssetStatementNotArray() throws Exception {
RelatedApplication manifestRelatedApps[] = new RelatedApplication[] { RelatedApplication manifestRelatedApps[] = new RelatedApplication[] {
createRelatedApplication(PLATFORM_ANDROID, PACKAGE_NAME_1, null)}; createRelatedApplication(PLATFORM_ANDROID, PACKAGE_NAME_1, null)};
...@@ -699,9 +660,7 @@ public class InstalledAppProviderTest { ...@@ -699,9 +660,7 @@ public class InstalledAppProviderTest {
} }
/** The Android app's asset statement array contains non-objects. */ /** The Android app's asset statement array contains non-objects. */
@Test @CalledByNativeJavaTest
@SmallTest
@UiThreadTest
public void testAssetStatementArrayNoObjects() throws Exception { public void testAssetStatementArrayNoObjects() throws Exception {
RelatedApplication manifestRelatedApps[] = new RelatedApplication[] { RelatedApplication manifestRelatedApps[] = new RelatedApplication[] {
createRelatedApplication(PLATFORM_ANDROID, PACKAGE_NAME_1, null)}; createRelatedApplication(PLATFORM_ANDROID, PACKAGE_NAME_1, null)};
...@@ -721,9 +680,7 @@ public class InstalledAppProviderTest { ...@@ -721,9 +680,7 @@ public class InstalledAppProviderTest {
* <p>Currently, the relation string (in the Android package's asset statement) is ignored, so * <p>Currently, the relation string (in the Android package's asset statement) is ignored, so
* the app is still returned as "installed". * the app is still returned as "installed".
*/ */
@Test @CalledByNativeJavaTest
@SmallTest
@UiThreadTest
public void testAssetStatementNoRelation() throws Exception { public void testAssetStatementNoRelation() throws Exception {
RelatedApplication manifestRelatedApps[] = new RelatedApplication[] { RelatedApplication manifestRelatedApps[] = new RelatedApplication[] {
createRelatedApplication(PLATFORM_ANDROID, PACKAGE_NAME_1, null)}; createRelatedApplication(PLATFORM_ANDROID, PACKAGE_NAME_1, null)};
...@@ -744,9 +701,7 @@ public class InstalledAppProviderTest { ...@@ -744,9 +701,7 @@ public class InstalledAppProviderTest {
* <p>Currently, the relation string (in the Android package's asset statement) is ignored, so * <p>Currently, the relation string (in the Android package's asset statement) is ignored, so
* any will do. Is this desirable, or do we want to require a specific relation string? * any will do. Is this desirable, or do we want to require a specific relation string?
*/ */
@Test @CalledByNativeJavaTest
@SmallTest
@UiThreadTest
public void testAssetStatementNonStandardRelation() throws Exception { public void testAssetStatementNonStandardRelation() throws Exception {
RelatedApplication manifestRelatedApps[] = new RelatedApplication[] { RelatedApplication manifestRelatedApps[] = new RelatedApplication[] {
createRelatedApplication(PLATFORM_ANDROID, PACKAGE_NAME_1, null)}; createRelatedApplication(PLATFORM_ANDROID, PACKAGE_NAME_1, null)};
...@@ -760,9 +715,7 @@ public class InstalledAppProviderTest { ...@@ -760,9 +715,7 @@ public class InstalledAppProviderTest {
} }
/** Android app has no "target" in the asset statement. */ /** Android app has no "target" in the asset statement. */
@Test @CalledByNativeJavaTest
@SmallTest
@UiThreadTest
public void testAssetStatementNoTarget() throws Exception { public void testAssetStatementNoTarget() throws Exception {
RelatedApplication manifestRelatedApps[] = new RelatedApplication[] { RelatedApplication manifestRelatedApps[] = new RelatedApplication[] {
createRelatedApplication(PLATFORM_ANDROID, PACKAGE_NAME_1, null)}; createRelatedApplication(PLATFORM_ANDROID, PACKAGE_NAME_1, null)};
...@@ -775,9 +728,7 @@ public class InstalledAppProviderTest { ...@@ -775,9 +728,7 @@ public class InstalledAppProviderTest {
} }
/** Android app has no "namespace" in the asset statement. */ /** Android app has no "namespace" in the asset statement. */
@Test @CalledByNativeJavaTest
@SmallTest
@UiThreadTest
public void testAssetStatementNoNamespace() throws Exception { public void testAssetStatementNoNamespace() throws Exception {
RelatedApplication manifestRelatedApps[] = new RelatedApplication[] { RelatedApplication manifestRelatedApps[] = new RelatedApplication[] {
createRelatedApplication(PLATFORM_ANDROID, PACKAGE_NAME_1, null)}; createRelatedApplication(PLATFORM_ANDROID, PACKAGE_NAME_1, null)};
...@@ -792,9 +743,7 @@ public class InstalledAppProviderTest { ...@@ -792,9 +743,7 @@ public class InstalledAppProviderTest {
} }
/** Android app is related, but not to the web namespace. */ /** Android app is related, but not to the web namespace. */
@Test @CalledByNativeJavaTest
@SmallTest
@UiThreadTest
public void testNonWebAssetStatement() throws Exception { public void testNonWebAssetStatement() throws Exception {
RelatedApplication manifestRelatedApps[] = new RelatedApplication[] { RelatedApplication manifestRelatedApps[] = new RelatedApplication[] {
createRelatedApplication(PLATFORM_ANDROID, PACKAGE_NAME_1, null)}; createRelatedApplication(PLATFORM_ANDROID, PACKAGE_NAME_1, null)};
...@@ -806,9 +755,7 @@ public class InstalledAppProviderTest { ...@@ -806,9 +755,7 @@ public class InstalledAppProviderTest {
} }
/** Android app has no "site" in the asset statement. */ /** Android app has no "site" in the asset statement. */
@Test @CalledByNativeJavaTest
@SmallTest
@UiThreadTest
public void testAssetStatementNoSite() throws Exception { public void testAssetStatementNoSite() throws Exception {
RelatedApplication manifestRelatedApps[] = new RelatedApplication[] { RelatedApplication manifestRelatedApps[] = new RelatedApplication[] {
createRelatedApplication(PLATFORM_ANDROID, PACKAGE_NAME_1, null)}; createRelatedApplication(PLATFORM_ANDROID, PACKAGE_NAME_1, null)};
...@@ -823,9 +770,7 @@ public class InstalledAppProviderTest { ...@@ -823,9 +770,7 @@ public class InstalledAppProviderTest {
} }
/** Android app has a syntax error in the "site" field of the asset statement. */ /** Android app has a syntax error in the "site" field of the asset statement. */
@Test @CalledByNativeJavaTest
@SmallTest
@UiThreadTest
public void testAssetStatementSiteSyntaxError() throws Exception { public void testAssetStatementSiteSyntaxError() throws Exception {
RelatedApplication manifestRelatedApps[] = new RelatedApplication[] { RelatedApplication manifestRelatedApps[] = new RelatedApplication[] {
createRelatedApplication(PLATFORM_ANDROID, PACKAGE_NAME_1, null)}; createRelatedApplication(PLATFORM_ANDROID, PACKAGE_NAME_1, null)};
...@@ -838,10 +783,8 @@ public class InstalledAppProviderTest { ...@@ -838,10 +783,8 @@ public class InstalledAppProviderTest {
} }
/** Android app has a "site" field missing certain parts of the URI (scheme, host, port). */ /** Android app has a "site" field missing certain parts of the URI (scheme, host, port). */
@Test // Disabled test: https://crbug.com/1052429
@SmallTest @DisabledCalledByNativeJavaTest
@UiThreadTest
@DisabledTest(message = "https://crbug.com/1052429")
public void testAssetStatementSiteMissingParts() throws Exception { public void testAssetStatementSiteMissingParts() throws Exception {
RelatedApplication manifestRelatedApps[] = new RelatedApplication[] { RelatedApplication manifestRelatedApps[] = new RelatedApplication[] {
createRelatedApplication(PLATFORM_ANDROID, PACKAGE_NAME_1, null)}; createRelatedApplication(PLATFORM_ANDROID, PACKAGE_NAME_1, null)};
...@@ -866,9 +809,7 @@ public class InstalledAppProviderTest { ...@@ -866,9 +809,7 @@ public class InstalledAppProviderTest {
* <p>The path part shouldn't really be there (according to the Digital Asset Links spec), but * <p>The path part shouldn't really be there (according to the Digital Asset Links spec), but
* if it is, we are lenient and just ignore it (matching only the origin). * if it is, we are lenient and just ignore it (matching only the origin).
*/ */
@Test @CalledByNativeJavaTest
@SmallTest
@UiThreadTest
public void testAssetStatementSiteHasPath() throws Exception { public void testAssetStatementSiteHasPath() throws Exception {
RelatedApplication manifestRelatedApps[] = new RelatedApplication[] { RelatedApplication manifestRelatedApps[] = new RelatedApplication[] {
createRelatedApplication(PLATFORM_ANDROID, PACKAGE_NAME_1, null)}; createRelatedApplication(PLATFORM_ANDROID, PACKAGE_NAME_1, null)};
...@@ -885,9 +826,7 @@ public class InstalledAppProviderTest { ...@@ -885,9 +826,7 @@ public class InstalledAppProviderTest {
* *
* <p>Another Android app relates to the web app, but not mutual. * <p>Another Android app relates to the web app, but not mutual.
*/ */
@Test @CalledByNativeJavaTest
@SmallTest
@UiThreadTest
public void testExtraInstalledApp() throws Exception { public void testExtraInstalledApp() throws Exception {
RelatedApplication manifestRelatedApps[] = new RelatedApplication[] { RelatedApplication manifestRelatedApps[] = new RelatedApplication[] {
createRelatedApplication(PLATFORM_ANDROID, PACKAGE_NAME_1, null)}; createRelatedApplication(PLATFORM_ANDROID, PACKAGE_NAME_1, null)};
...@@ -905,9 +844,7 @@ public class InstalledAppProviderTest { ...@@ -905,9 +844,7 @@ public class InstalledAppProviderTest {
* <p>Web app also related to an app with the same name on another platform, and another Android * <p>Web app also related to an app with the same name on another platform, and another Android
* app which is not installed. * app which is not installed.
*/ */
@Test @CalledByNativeJavaTest
@SmallTest
@UiThreadTest
public void testMultipleInstalledRelatedApps() throws Exception { public void testMultipleInstalledRelatedApps() throws Exception {
RelatedApplication[] manifestRelatedApps = new RelatedApplication[] { RelatedApplication[] manifestRelatedApps = new RelatedApplication[] {
createRelatedApplication(PLATFORM_ANDROID, PACKAGE_NAME_1, null), createRelatedApplication(PLATFORM_ANDROID, PACKAGE_NAME_1, null),
...@@ -923,9 +860,7 @@ public class InstalledAppProviderTest { ...@@ -923,9 +860,7 @@ public class InstalledAppProviderTest {
} }
/** Tests the pseudo-random artificial delay to counter a timing attack. */ /** Tests the pseudo-random artificial delay to counter a timing attack. */
@Test @CalledByNativeJavaTest
@SmallTest
@UiThreadTest
public void testArtificialDelay() throws Exception { public void testArtificialDelay() throws Exception {
byte[] salt = {0x64, 0x09, -0x68, -0x25, 0x70, 0x11, 0x25, 0x24, 0x68, -0x1a, 0x08, 0x79, byte[] salt = {0x64, 0x09, -0x68, -0x25, 0x70, 0x11, 0x25, 0x24, 0x68, -0x1a, 0x08, 0x79,
-0x12, -0x50, 0x3b, -0x57, -0x17, -0x4d, 0x46, 0x02}; -0x12, -0x50, 0x3b, -0x57, -0x17, -0x4d, 0x46, 0x02};
...@@ -969,9 +904,7 @@ public class InstalledAppProviderTest { ...@@ -969,9 +904,7 @@ public class InstalledAppProviderTest {
Assert.assertEquals(8, mInstalledAppProvider.getLastDelayMillis()); Assert.assertEquals(8, mInstalledAppProvider.getLastDelayMillis());
} }
@Test @CalledByNativeJavaTest
@SmallTest
@UiThreadTest
public void testMultipleAppsIncludingInstantApps() throws Exception { public void testMultipleAppsIncludingInstantApps() throws Exception {
RelatedApplication[] manifestRelatedApps = new RelatedApplication[] { RelatedApplication[] manifestRelatedApps = new RelatedApplication[] {
createRelatedApplication(PLATFORM_ANDROID, PACKAGE_NAME_1, null), createRelatedApplication(PLATFORM_ANDROID, PACKAGE_NAME_1, null),
...@@ -993,9 +926,7 @@ public class InstalledAppProviderTest { ...@@ -993,9 +926,7 @@ public class InstalledAppProviderTest {
* Multiple related uninstalled apps (over the allowed limit) followed by one related Android * Multiple related uninstalled apps (over the allowed limit) followed by one related Android
* app which is installed and mutually related. * app which is installed and mutually related.
*/ */
@Test @CalledByNativeJavaTest
@SmallTest
@UiThreadTest
public void testRelatedAppsOverAllowedThreshold() throws Exception { public void testRelatedAppsOverAllowedThreshold() throws Exception {
RelatedApplication manifestRelatedApps[] = RelatedApplication manifestRelatedApps[] =
new RelatedApplication[MAX_ALLOWED_RELATED_APPS + 1]; new RelatedApplication[MAX_ALLOWED_RELATED_APPS + 1];
...@@ -1016,9 +947,7 @@ public class InstalledAppProviderTest { ...@@ -1016,9 +947,7 @@ public class InstalledAppProviderTest {
/** /**
* Check that a website can find its own WebAPK when installed. * Check that a website can find its own WebAPK when installed.
*/ */
@Test @CalledByNativeJavaTest
@SmallTest
@UiThreadTest
public void testInstalledWebApkForWebsite() throws Exception { public void testInstalledWebApkForWebsite() throws Exception {
RelatedApplication webApk = createRelatedApplication(PLATFORM_WEBAPP, null, MANIFEST_URL); RelatedApplication webApk = createRelatedApplication(PLATFORM_WEBAPP, null, MANIFEST_URL);
RelatedApplication manifestRelatedApps[] = new RelatedApplication[] {webApk}; RelatedApplication manifestRelatedApps[] = new RelatedApplication[] {webApk};
...@@ -1031,9 +960,7 @@ public class InstalledAppProviderTest { ...@@ -1031,9 +960,7 @@ public class InstalledAppProviderTest {
/** /**
* Check that a website can find another WebAPK when installed & verfied. * Check that a website can find another WebAPK when installed & verfied.
*/ */
@Test @CalledByNativeJavaTest
@SmallTest
@UiThreadTest
public void testInstalledWebApkForOtherWebsite() throws Exception { public void testInstalledWebApkForOtherWebsite() throws Exception {
RelatedApplication webApk = RelatedApplication webApk =
createRelatedApplication(PLATFORM_WEBAPP, null, OTHER_MANIFEST_URL); createRelatedApplication(PLATFORM_WEBAPP, null, OTHER_MANIFEST_URL);
...@@ -1049,9 +976,7 @@ public class InstalledAppProviderTest { ...@@ -1049,9 +976,7 @@ public class InstalledAppProviderTest {
/** /**
* Check that a website can query another WebAPK when not installed but verfied. * Check that a website can query another WebAPK when not installed but verfied.
*/ */
@Test @CalledByNativeJavaTest
@SmallTest
@UiThreadTest
public void testInstalledWebApkForOtherWebsiteNotInstalled() throws Exception { public void testInstalledWebApkForOtherWebsiteNotInstalled() throws Exception {
RelatedApplication webApk = RelatedApplication webApk =
createRelatedApplication(PLATFORM_WEBAPP, null, OTHER_MANIFEST_URL); createRelatedApplication(PLATFORM_WEBAPP, null, OTHER_MANIFEST_URL);
......
...@@ -10,31 +10,20 @@ import static org.junit.Assert.assertTrue; ...@@ -10,31 +10,20 @@ import static org.junit.Assert.assertTrue;
import android.app.Notification; import android.app.Notification;
import androidx.test.filters.SmallTest; import org.chromium.base.annotations.CalledByNative;
import org.chromium.base.annotations.CalledByNativeJavaTest;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.chromium.base.test.BaseJUnit4ClassRunner;
import org.chromium.base.test.util.Batch;
import org.chromium.base.test.util.Feature; import org.chromium.base.test.util.Feature;
import org.chromium.chrome.browser.notifications.channels.ChromeChannelDefinitions; import org.chromium.chrome.browser.notifications.channels.ChromeChannelDefinitions;
import org.chromium.chrome.browser.notifications.channels.SiteChannelsManager; import org.chromium.chrome.browser.notifications.channels.SiteChannelsManager;
import org.chromium.content_public.browser.test.NativeLibraryTestUtils;
import java.util.Arrays; import java.util.Arrays;
/** /**
* Unit tests for NotificationPlatformBridge. * Unit tests for NotificationPlatformBridge.
*/ */
@RunWith(BaseJUnit4ClassRunner.class)
@Batch(Batch.UNIT_TESTS)
public class NotificationPlatformBridgeUnitTest { public class NotificationPlatformBridgeUnitTest {
@Before @CalledByNative
public void setUp() { private NotificationPlatformBridgeUnitTest() {}
NativeLibraryTestUtils.loadNativeLibraryNoBrowserProcess();
}
/** /**
* Verifies that the getOriginFromTag method returns the origin for valid input, and null for * Verifies that the getOriginFromTag method returns the origin for valid input, and null for
...@@ -43,8 +32,7 @@ public class NotificationPlatformBridgeUnitTest { ...@@ -43,8 +32,7 @@ public class NotificationPlatformBridgeUnitTest {
* This is defined in functions in notification_id_generator.cc. * This is defined in functions in notification_id_generator.cc.
*/ */
@Feature({"Browser", "Notifications"}) @Feature({"Browser", "Notifications"})
@SmallTest @CalledByNativeJavaTest
@Test
public void testGetOriginFromNotificationTag() { public void testGetOriginFromNotificationTag() {
// The common case. // The common case.
assertEquals("https://example.com", assertEquals("https://example.com",
...@@ -73,8 +61,7 @@ public class NotificationPlatformBridgeUnitTest { ...@@ -73,8 +61,7 @@ public class NotificationPlatformBridgeUnitTest {
* and null for any other channel or a null channel id. * and null for any other channel or a null channel id.
*/ */
@Feature({"Browser", "Notifications"}) @Feature({"Browser", "Notifications"})
@SmallTest @CalledByNativeJavaTest
@Test
public void testGetOriginFromChannelId() { public void testGetOriginFromChannelId() {
// Returns the expected origin for a channel id associated with a particular origin. // Returns the expected origin for a channel id associated with a particular origin.
assertEquals("https://example.com", assertEquals("https://example.com",
...@@ -95,8 +82,7 @@ public class NotificationPlatformBridgeUnitTest { ...@@ -95,8 +82,7 @@ public class NotificationPlatformBridgeUnitTest {
* Verifies that the makeDefaults method returns the generated notification defaults. * Verifies that the makeDefaults method returns the generated notification defaults.
*/ */
@Feature({"Browser", "Notifications"}) @Feature({"Browser", "Notifications"})
@SmallTest @CalledByNativeJavaTest
@Test
public void testMakeDefaults() { public void testMakeDefaults() {
// 0 should be returned if pattern length is 0, silent is true, and vibration is enabled. // 0 should be returned if pattern length is 0, silent is true, and vibration is enabled.
assertEquals(0, NotificationPlatformBridge.makeDefaults(0, true, true)); assertEquals(0, NotificationPlatformBridge.makeDefaults(0, true, true));
...@@ -122,8 +108,7 @@ public class NotificationPlatformBridgeUnitTest { ...@@ -122,8 +108,7 @@ public class NotificationPlatformBridgeUnitTest {
* in Android notification. * in Android notification.
*/ */
@Feature({"Browser", "Notifications"}) @Feature({"Browser", "Notifications"})
@SmallTest @CalledByNativeJavaTest
@Test
public void testMakeVibrationPattern() { public void testMakeVibrationPattern() {
assertTrue(Arrays.equals(new long[] {0, 100, 200, 300}, assertTrue(Arrays.equals(new long[] {0, 100, 200, 300},
NotificationPlatformBridge.makeVibrationPattern(new int[] {100, 200, 300}))); NotificationPlatformBridge.makeVibrationPattern(new int[] {100, 200, 300})));
......
...@@ -4,32 +4,21 @@ ...@@ -4,32 +4,21 @@
package org.chromium.chrome.browser.partnercustomizations; package org.chromium.chrome.browser.partnercustomizations;
import androidx.test.filters.SmallTest;
import org.junit.Assert; import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.chromium.base.test.BaseJUnit4ClassRunner; import org.chromium.base.annotations.CalledByNative;
import org.chromium.base.test.util.Batch; import org.chromium.base.annotations.CalledByNativeJavaTest;
import org.chromium.base.test.util.Feature; import org.chromium.base.test.util.Feature;
import org.chromium.content_public.browser.test.NativeLibraryTestUtils;
/** /**
* Unit tests for {@link PartnerBrowserCustomizations}. * Unit tests for {@link PartnerBrowserCustomizations}.
*/ */
@RunWith(BaseJUnit4ClassRunner.class)
@Batch(Batch.UNIT_TESTS)
public class PartnerBrowserCustomizationsUnitTest { public class PartnerBrowserCustomizationsUnitTest {
@Before @CalledByNative
public void setUp() { private PartnerBrowserCustomizationsUnitTest() {}
NativeLibraryTestUtils.loadNativeLibraryNoBrowserProcess();
}
@Feature({"Homepage"}) @Feature({"Homepage"})
@SmallTest @CalledByNativeJavaTest
@Test
public void testIsValidHomepage() { public void testIsValidHomepage() {
Assert.assertTrue(PartnerBrowserCustomizations.isValidHomepage( Assert.assertTrue(PartnerBrowserCustomizations.isValidHomepage(
"chrome-native://newtab/path#fragment")); "chrome-native://newtab/path#fragment"));
......
...@@ -13,20 +13,12 @@ import android.content.pm.ServiceInfo; ...@@ -13,20 +13,12 @@ import android.content.pm.ServiceInfo;
import android.content.pm.Signature; import android.content.pm.Signature;
import android.os.Bundle; import android.os.Bundle;
import androidx.test.filters.SmallTest;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.ArgumentMatcher; import org.mockito.ArgumentMatcher;
import org.mockito.ArgumentMatchers; import org.mockito.ArgumentMatchers;
import org.mockito.Mockito; import org.mockito.Mockito;
import org.chromium.base.test.BaseJUnit4ClassRunner; import org.chromium.base.annotations.CalledByNative;
import org.chromium.base.test.UiThreadTest; import org.chromium.base.annotations.CalledByNativeJavaTest;
import org.chromium.base.test.util.Batch;
import org.chromium.chrome.test.ChromeBrowserTestRule;
import org.chromium.components.payments.PackageManagerDelegate; import org.chromium.components.payments.PackageManagerDelegate;
import org.chromium.components.payments.PaymentApp; import org.chromium.components.payments.PaymentApp;
import org.chromium.components.payments.PaymentAppFactoryParams; import org.chromium.components.payments.PaymentAppFactoryParams;
...@@ -35,7 +27,6 @@ import org.chromium.components.payments.PaymentManifestParser; ...@@ -35,7 +27,6 @@ import org.chromium.components.payments.PaymentManifestParser;
import org.chromium.components.payments.PaymentManifestWebDataService; import org.chromium.components.payments.PaymentManifestWebDataService;
import org.chromium.components.payments.WebAppManifestSection; import org.chromium.components.payments.WebAppManifestSection;
import org.chromium.content_public.browser.WebContents; import org.chromium.content_public.browser.WebContents;
import org.chromium.content_public.browser.test.NativeLibraryTestUtils;
import org.chromium.payments.mojom.PaymentDetailsModifier; import org.chromium.payments.mojom.PaymentDetailsModifier;
import org.chromium.payments.mojom.PaymentMethodData; import org.chromium.payments.mojom.PaymentMethodData;
import org.chromium.url.GURL; import org.chromium.url.GURL;
...@@ -47,21 +38,12 @@ import java.util.List; ...@@ -47,21 +38,12 @@ import java.util.List;
import java.util.Map; import java.util.Map;
/** Tests for the native Android payment app finder. */ /** Tests for the native Android payment app finder. */
@RunWith(BaseJUnit4ClassRunner.class)
@Batch(AndroidPaymentAppFinderUnitTest.PAYMENTS_BROWSER_UNIT_TESTS)
public class AndroidPaymentAppFinderUnitTest { public class AndroidPaymentAppFinderUnitTest {
// Collection of payments unit tests that require the browser process to be initialized.
static final String PAYMENTS_BROWSER_UNIT_TESTS = "PaymentsBrowserUnitTests";
private static final IntentArgumentMatcher sPayIntentArgumentMatcher = private static final IntentArgumentMatcher sPayIntentArgumentMatcher =
new IntentArgumentMatcher(new Intent("org.chromium.intent.action.PAY")); new IntentArgumentMatcher(new Intent("org.chromium.intent.action.PAY"));
@Rule @CalledByNative
public ChromeBrowserTestRule mTestRule = new ChromeBrowserTestRule(); private AndroidPaymentAppFinderUnitTest() {}
@Before
public void setUp() {
NativeLibraryTestUtils.loadNativeLibraryAndInitBrowserProcess();
}
/** /**
* Argument matcher that matches Intents using |filterEquals| method. * Argument matcher that matches Intents using |filterEquals| method.
...@@ -126,9 +108,7 @@ public class AndroidPaymentAppFinderUnitTest { ...@@ -126,9 +108,7 @@ public class AndroidPaymentAppFinderUnitTest {
Mockito.verify(delegate).onDoneCreatingPaymentApps(/*factory=*/null); Mockito.verify(delegate).onDoneCreatingPaymentApps(/*factory=*/null);
} }
@SmallTest @CalledByNativeJavaTest
@Test
@UiThreadTest
public void testNoValidPaymentMethodNames() { public void testNoValidPaymentMethodNames() {
verifyNoAppsFound(findApps(new String[] {"unknown-payment-method-name", verifyNoAppsFound(findApps(new String[] {"unknown-payment-method-name",
"http://not.secure.payment.method.name.com", "https://"}, "http://not.secure.payment.method.name.com", "https://"},
...@@ -137,9 +117,7 @@ public class AndroidPaymentAppFinderUnitTest { ...@@ -137,9 +117,7 @@ public class AndroidPaymentAppFinderUnitTest {
Mockito.mock(PackageManagerDelegate.class))); Mockito.mock(PackageManagerDelegate.class)));
} }
@SmallTest @CalledByNativeJavaTest
@Test
@UiThreadTest
public void testQueryWithoutApps() { public void testQueryWithoutApps() {
PackageManagerDelegate packageManagerDelegate = Mockito.mock(PackageManagerDelegate.class); PackageManagerDelegate packageManagerDelegate = Mockito.mock(PackageManagerDelegate.class);
Mockito.when(packageManagerDelegate.getActivitiesThatCanRespondToIntentWithMetaData( Mockito.when(packageManagerDelegate.getActivitiesThatCanRespondToIntentWithMetaData(
...@@ -155,9 +133,7 @@ public class AndroidPaymentAppFinderUnitTest { ...@@ -155,9 +133,7 @@ public class AndroidPaymentAppFinderUnitTest {
ArgumentMatchers.any(ApplicationInfo.class), ArgumentMatchers.anyInt()); ArgumentMatchers.any(ApplicationInfo.class), ArgumentMatchers.anyInt());
} }
@SmallTest @CalledByNativeJavaTest
@Test
@UiThreadTest
public void testQueryWithoutMetaData() { public void testQueryWithoutMetaData() {
List<ResolveInfo> activities = new ArrayList<>(); List<ResolveInfo> activities = new ArrayList<>();
ResolveInfo alicePay = new ResolveInfo(); ResolveInfo alicePay = new ResolveInfo();
...@@ -182,9 +158,7 @@ public class AndroidPaymentAppFinderUnitTest { ...@@ -182,9 +158,7 @@ public class AndroidPaymentAppFinderUnitTest {
ArgumentMatchers.any(ApplicationInfo.class), ArgumentMatchers.anyInt()); ArgumentMatchers.any(ApplicationInfo.class), ArgumentMatchers.anyInt());
} }
@SmallTest @CalledByNativeJavaTest
@Test
@UiThreadTest
public void testQueryWithoutLabel() { public void testQueryWithoutLabel() {
List<ResolveInfo> activities = new ArrayList<>(); List<ResolveInfo> activities = new ArrayList<>();
ResolveInfo alicePay = new ResolveInfo(); ResolveInfo alicePay = new ResolveInfo();
...@@ -212,9 +186,7 @@ public class AndroidPaymentAppFinderUnitTest { ...@@ -212,9 +186,7 @@ public class AndroidPaymentAppFinderUnitTest {
ArgumentMatchers.any(ApplicationInfo.class), ArgumentMatchers.anyInt()); ArgumentMatchers.any(ApplicationInfo.class), ArgumentMatchers.anyInt());
} }
@SmallTest @CalledByNativeJavaTest
@Test
@UiThreadTest
public void testQueryUnsupportedPaymentMethod() { public void testQueryUnsupportedPaymentMethod() {
PackageManagerDelegate packageManagerDelegate = installPaymentApps( PackageManagerDelegate packageManagerDelegate = installPaymentApps(
new String[] {"com.alicepay.app"}, new String[] {"unsupported-payment-method"}); new String[] {"com.alicepay.app"}, new String[] {"unsupported-payment-method"});
...@@ -254,9 +226,7 @@ public class AndroidPaymentAppFinderUnitTest { ...@@ -254,9 +226,7 @@ public class AndroidPaymentAppFinderUnitTest {
return packageManagerDelegate; return packageManagerDelegate;
} }
@SmallTest @CalledByNativeJavaTest
@Test
@UiThreadTest
public void testQueryDifferentPaymentMethod() { public void testQueryDifferentPaymentMethod() {
PackageManagerDelegate packageManagerDelegate = PackageManagerDelegate packageManagerDelegate =
installPaymentApps(new String[] {"com.alicepay.app"}, new String[] {"basic-card"}); installPaymentApps(new String[] {"com.alicepay.app"}, new String[] {"basic-card"});
...@@ -270,9 +240,7 @@ public class AndroidPaymentAppFinderUnitTest { ...@@ -270,9 +240,7 @@ public class AndroidPaymentAppFinderUnitTest {
ArgumentMatchers.any(ApplicationInfo.class), ArgumentMatchers.anyInt()); ArgumentMatchers.any(ApplicationInfo.class), ArgumentMatchers.anyInt());
} }
@SmallTest @CalledByNativeJavaTest
@Test
@UiThreadTest
public void testQueryNoPaymentMethod() { public void testQueryNoPaymentMethod() {
PackageManagerDelegate packageManagerDelegate = PackageManagerDelegate packageManagerDelegate =
installPaymentApps(new String[] {"com.alicepay.app"}, new String[] {"basic-card"}); installPaymentApps(new String[] {"com.alicepay.app"}, new String[] {"basic-card"});
...@@ -285,9 +253,7 @@ public class AndroidPaymentAppFinderUnitTest { ...@@ -285,9 +253,7 @@ public class AndroidPaymentAppFinderUnitTest {
ArgumentMatchers.any(ApplicationInfo.class), ArgumentMatchers.anyInt()); ArgumentMatchers.any(ApplicationInfo.class), ArgumentMatchers.anyInt());
} }
@SmallTest @CalledByNativeJavaTest
@Test
@UiThreadTest
public void testQueryBasicCardsWithTwoApps() { public void testQueryBasicCardsWithTwoApps() {
List<ResolveInfo> activities = new ArrayList<>(); List<ResolveInfo> activities = new ArrayList<>();
ResolveInfo alicePay = new ResolveInfo(); ResolveInfo alicePay = new ResolveInfo();
...@@ -348,9 +314,7 @@ public class AndroidPaymentAppFinderUnitTest { ...@@ -348,9 +314,7 @@ public class AndroidPaymentAppFinderUnitTest {
Mockito.verify(delegate).onDoneCreatingPaymentApps(/*factory=*/null); Mockito.verify(delegate).onDoneCreatingPaymentApps(/*factory=*/null);
} }
@SmallTest @CalledByNativeJavaTest
@Test
@UiThreadTest
public void testQueryBobPayWithOneAppThatHasIsReadyToPayService() { public void testQueryBobPayWithOneAppThatHasIsReadyToPayService() {
List<ResolveInfo> activities = new ArrayList<>(); List<ResolveInfo> activities = new ArrayList<>();
ResolveInfo bobPay = new ResolveInfo(); ResolveInfo bobPay = new ResolveInfo();
......
...@@ -8,22 +8,15 @@ import android.app.Activity; ...@@ -8,22 +8,15 @@ import android.app.Activity;
import android.content.Intent; import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import androidx.test.filters.SmallTest;
import org.junit.Assert; import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock; import org.mockito.Mock;
import org.mockito.MockitoAnnotations; import org.mockito.MockitoAnnotations;
import org.chromium.base.test.BaseJUnit4ClassRunner; import org.chromium.base.annotations.CalledByNative;
import org.chromium.base.test.UiThreadTest; import org.chromium.base.annotations.CalledByNativeJavaTest;
import org.chromium.base.test.util.Batch;
import org.chromium.components.payments.PayerData; import org.chromium.components.payments.PayerData;
import org.chromium.components.payments.PaymentApp; import org.chromium.components.payments.PaymentApp;
import org.chromium.components.payments.SupportedDelegations; import org.chromium.components.payments.SupportedDelegations;
import org.chromium.content_public.browser.test.NativeLibraryTestUtils;
import org.chromium.content_public.browser.test.util.CriteriaHelper; import org.chromium.content_public.browser.test.util.CriteriaHelper;
import org.chromium.payments.mojom.PaymentCurrencyAmount; import org.chromium.payments.mojom.PaymentCurrencyAmount;
import org.chromium.payments.mojom.PaymentDetailsModifier; import org.chromium.payments.mojom.PaymentDetailsModifier;
...@@ -37,8 +30,6 @@ import java.util.HashMap; ...@@ -37,8 +30,6 @@ import java.util.HashMap;
import java.util.Map; import java.util.Map;
/** Tests for the native Android payment app finder. */ /** Tests for the native Android payment app finder. */
@RunWith(BaseJUnit4ClassRunner.class)
@Batch(Batch.UNIT_TESTS)
public class AndroidPaymentAppUnitTest { public class AndroidPaymentAppUnitTest {
@Mock @Mock
private AndroidPaymentApp.Launcher mLauncherMock; private AndroidPaymentApp.Launcher mLauncherMock;
...@@ -50,14 +41,10 @@ public class AndroidPaymentAppUnitTest { ...@@ -50,14 +41,10 @@ public class AndroidPaymentAppUnitTest {
private boolean mReadyToPayQueryFinished; private boolean mReadyToPayQueryFinished;
private boolean mInvokePaymentAppFinished; private boolean mInvokePaymentAppFinished;
@Before @CalledByNative
public void setUp() { private AndroidPaymentAppUnitTest() {}
NativeLibraryTestUtils.loadNativeLibraryNoBrowserProcess();
}
@SmallTest @CalledByNativeJavaTest
@Test
@UiThreadTest
public void testSuccessfulPaymentWithoutIsReadyToPayService() throws Exception { public void testSuccessfulPaymentWithoutIsReadyToPayService() throws Exception {
runTest(Activity.RESULT_OK); runTest(Activity.RESULT_OK);
Assert.assertNull(mErrorMessage); Assert.assertNull(mErrorMessage);
...@@ -65,9 +52,7 @@ public class AndroidPaymentAppUnitTest { ...@@ -65,9 +52,7 @@ public class AndroidPaymentAppUnitTest {
Assert.assertEquals("{}", mPaymentDetails); Assert.assertEquals("{}", mPaymentDetails);
} }
@SmallTest @CalledByNativeJavaTest
@Test
@UiThreadTest
public void testCancelledPaymentWithoutIsReadyToPayService() throws Exception { public void testCancelledPaymentWithoutIsReadyToPayService() throws Exception {
runTest(Activity.RESULT_CANCELED); runTest(Activity.RESULT_CANCELED);
Assert.assertEquals("Payment app returned RESULT_CANCELED code. This is how payment apps " Assert.assertEquals("Payment app returned RESULT_CANCELED code. This is how payment apps "
......
# TEAM: payments-dev@chromium.org
# COMPONENT: UI>Browser>Payments
file://components/payments/OWNERS
...@@ -9,19 +9,12 @@ import android.content.pm.PackageInfo; ...@@ -9,19 +9,12 @@ import android.content.pm.PackageInfo;
import android.content.pm.ResolveInfo; import android.content.pm.ResolveInfo;
import android.content.pm.Signature; import android.content.pm.Signature;
import androidx.test.filters.SmallTest;
import org.junit.Assert; import org.junit.Assert;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mockito; import org.mockito.Mockito;
import org.chromium.base.test.BaseJUnit4ClassRunner; import org.chromium.base.annotations.CalledByNative;
import org.chromium.base.test.util.Batch; import org.chromium.base.annotations.CalledByNativeJavaTest;
import org.chromium.chrome.browser.payments.PaymentManifestVerifier.ManifestVerifyCallback; import org.chromium.chrome.browser.payments.PaymentManifestVerifier.ManifestVerifyCallback;
import org.chromium.chrome.test.ChromeBrowserTestRule;
import org.chromium.components.payments.PackageManagerDelegate; import org.chromium.components.payments.PackageManagerDelegate;
import org.chromium.components.payments.PaymentManifestDownloader; import org.chromium.components.payments.PaymentManifestDownloader;
import org.chromium.components.payments.PaymentManifestParser; import org.chromium.components.payments.PaymentManifestParser;
...@@ -29,7 +22,6 @@ import org.chromium.components.payments.PaymentManifestWebDataService; ...@@ -29,7 +22,6 @@ import org.chromium.components.payments.PaymentManifestWebDataService;
import org.chromium.components.payments.PaymentManifestWebDataService.PaymentManifestWebDataServiceCallback; import org.chromium.components.payments.PaymentManifestWebDataService.PaymentManifestWebDataServiceCallback;
import org.chromium.components.payments.WebAppManifestSection; import org.chromium.components.payments.WebAppManifestSection;
import org.chromium.content_public.browser.WebContents; import org.chromium.content_public.browser.WebContents;
import org.chromium.content_public.browser.test.NativeLibraryTestUtils;
import org.chromium.url.GURL; import org.chromium.url.GURL;
import org.chromium.url.Origin; import org.chromium.url.Origin;
...@@ -37,21 +29,19 @@ import java.util.HashSet; ...@@ -37,21 +29,19 @@ import java.util.HashSet;
import java.util.Set; import java.util.Set;
/** A test for the verifier of a payment app manifest. */ /** A test for the verifier of a payment app manifest. */
@RunWith(BaseJUnit4ClassRunner.class)
@Batch(AndroidPaymentAppFinderUnitTest.PAYMENTS_BROWSER_UNIT_TESTS)
public class PaymentManifestVerifierTest { public class PaymentManifestVerifierTest {
private static final String ERROR_MESSAGE = "This is an error message."; private static final String ERROR_MESSAGE = "This is an error message.";
private Origin mTestOrigin; private final Origin mTestOrigin;
private GURL mMethodName; private final GURL mMethodName;
private ResolveInfo mAlicePay; private final ResolveInfo mAlicePay;
private ResolveInfo mBobPay; private final ResolveInfo mBobPay;
private Set<ResolveInfo> mMatchingApps; private final Set<ResolveInfo> mMatchingApps;
private PaymentManifestDownloader mDownloader; private final PaymentManifestDownloader mDownloader;
private PaymentManifestWebDataService mWebDataService; private final PaymentManifestWebDataService mWebDataService;
private PaymentManifestParser mParser; private final PaymentManifestParser mParser;
private PackageManagerDelegate mPackageManagerDelegate; private final PackageManagerDelegate mPackageManagerDelegate;
private ManifestVerifyCallback mCallback; private final ManifestVerifyCallback mCallback;
// SHA256("01020304050607080900"): // SHA256("01020304050607080900"):
public static final byte[][] BOB_PAY_SIGNATURE_FINGERPRINTS = {{(byte) 0x9A, (byte) 0x89, public static final byte[][] BOB_PAY_SIGNATURE_FINGERPRINTS = {{(byte) 0x9A, (byte) 0x89,
...@@ -62,13 +52,8 @@ public class PaymentManifestVerifierTest { ...@@ -62,13 +52,8 @@ public class PaymentManifestVerifierTest {
(byte) 0x09, (byte) 0xC4, (byte) 0x74, (byte) 0xF5, (byte) 0x93, (byte) 0xFB}}; (byte) 0x09, (byte) 0xC4, (byte) 0x74, (byte) 0xF5, (byte) 0x93, (byte) 0xFB}};
public static final Signature BOB_PAY_SIGNATURE = new Signature("01020304050607080900"); public static final Signature BOB_PAY_SIGNATURE = new Signature("01020304050607080900");
@Rule @CalledByNative
public ChromeBrowserTestRule mTestRule = new ChromeBrowserTestRule(); private PaymentManifestVerifierTest() {
@Before
public void setUp() {
NativeLibraryTestUtils.loadNativeLibraryAndInitBrowserProcess();
mTestOrigin = PaymentManifestDownloader.createOpaqueOriginForTest(); mTestOrigin = PaymentManifestDownloader.createOpaqueOriginForTest();
mMethodName = new GURL("https://example.com"); mMethodName = new GURL("https://example.com");
...@@ -147,8 +132,7 @@ public class PaymentManifestVerifierTest { ...@@ -147,8 +132,7 @@ public class PaymentManifestVerifierTest {
mCallback = Mockito.mock(ManifestVerifyCallback.class); mCallback = Mockito.mock(ManifestVerifyCallback.class);
} }
@SmallTest @CalledByNativeJavaTest
@Test
public void testUnableToDownloadPaymentMethodManifest() { public void testUnableToDownloadPaymentMethodManifest() {
PaymentManifestVerifier verifier = new PaymentManifestVerifier(mTestOrigin, mMethodName, PaymentManifestVerifier verifier = new PaymentManifestVerifier(mTestOrigin, mMethodName,
mMatchingApps, null /* supportedOrigins */, mMatchingApps, null /* supportedOrigins */,
...@@ -172,8 +156,7 @@ public class PaymentManifestVerifierTest { ...@@ -172,8 +156,7 @@ public class PaymentManifestVerifierTest {
.onValidDefaultPaymentApp(Mockito.any(GURL.class), Mockito.any(ResolveInfo.class)); .onValidDefaultPaymentApp(Mockito.any(GURL.class), Mockito.any(ResolveInfo.class));
} }
@SmallTest @CalledByNativeJavaTest
@Test
public void testUnableToDownloadWebAppManifest() { public void testUnableToDownloadWebAppManifest() {
PaymentManifestVerifier verifier = new PaymentManifestVerifier(mTestOrigin, mMethodName, PaymentManifestVerifier verifier = new PaymentManifestVerifier(mTestOrigin, mMethodName,
mMatchingApps, null /* supportedOrigins */, mMatchingApps, null /* supportedOrigins */,
...@@ -206,8 +189,7 @@ public class PaymentManifestVerifierTest { ...@@ -206,8 +189,7 @@ public class PaymentManifestVerifierTest {
Mockito.verify(mCallback).onFinishedUsingResources(); Mockito.verify(mCallback).onFinishedUsingResources();
} }
@SmallTest @CalledByNativeJavaTest
@Test
public void testUnableToParsePaymentMethodManifest() { public void testUnableToParsePaymentMethodManifest() {
PaymentManifestVerifier verifier = new PaymentManifestVerifier(mTestOrigin, mMethodName, PaymentManifestVerifier verifier = new PaymentManifestVerifier(mTestOrigin, mMethodName,
mMatchingApps, null /* supportedOrigins */, mWebDataService, mMatchingApps, null /* supportedOrigins */, mWebDataService,
...@@ -227,8 +209,7 @@ public class PaymentManifestVerifierTest { ...@@ -227,8 +209,7 @@ public class PaymentManifestVerifierTest {
Mockito.verify(mCallback).onFinishedUsingResources(); Mockito.verify(mCallback).onFinishedUsingResources();
} }
@SmallTest @CalledByNativeJavaTest
@Test
public void testUnableToParseWebAppManifest() { public void testUnableToParseWebAppManifest() {
PaymentManifestVerifier verifier = new PaymentManifestVerifier(mTestOrigin, mMethodName, PaymentManifestVerifier verifier = new PaymentManifestVerifier(mTestOrigin, mMethodName,
mMatchingApps, null /* supportedOrigins */, mWebDataService, mMatchingApps, null /* supportedOrigins */, mWebDataService,
...@@ -256,8 +237,7 @@ public class PaymentManifestVerifierTest { ...@@ -256,8 +237,7 @@ public class PaymentManifestVerifierTest {
Mockito.verify(mCallback).onFinishedUsingResources(); Mockito.verify(mCallback).onFinishedUsingResources();
} }
@SmallTest @CalledByNativeJavaTest
@Test
public void testBobPayAllowed() { public void testBobPayAllowed() {
PaymentManifestVerifier verifier = new PaymentManifestVerifier(mTestOrigin, mMethodName, PaymentManifestVerifier verifier = new PaymentManifestVerifier(mTestOrigin, mMethodName,
mMatchingApps, null /* supportedOrigins */, mWebDataService, mDownloader, mParser, mMatchingApps, null /* supportedOrigins */, mWebDataService, mDownloader, mParser,
...@@ -280,8 +260,7 @@ public class PaymentManifestVerifierTest { ...@@ -280,8 +260,7 @@ public class PaymentManifestVerifierTest {
} }
/** If a single web app manifest fails to download, all downloads should be aborted. */ /** If a single web app manifest fails to download, all downloads should be aborted. */
@SmallTest @CalledByNativeJavaTest
@Test
public void testFirstOfTwoManifestsFailsToDownload() { public void testFirstOfTwoManifestsFailsToDownload() {
CountingParser parser = new CountingParser() { CountingParser parser = new CountingParser() {
@Override @Override
...@@ -333,8 +312,7 @@ public class PaymentManifestVerifierTest { ...@@ -333,8 +312,7 @@ public class PaymentManifestVerifierTest {
} }
/** If a single web app manifest fails to parse, all downloads should be aborted. */ /** If a single web app manifest fails to parse, all downloads should be aborted. */
@SmallTest @CalledByNativeJavaTest
@Test
public void testFirstOfTwoManifestsFailsToParse() { public void testFirstOfTwoManifestsFailsToParse() {
CountingParser parser = new CountingParser() { CountingParser parser = new CountingParser() {
@Override @Override
......
...@@ -18,21 +18,14 @@ import static org.mockito.Mockito.when; ...@@ -18,21 +18,14 @@ import static org.mockito.Mockito.when;
import android.text.TextUtils; import android.text.TextUtils;
import androidx.test.filters.SmallTest;
import org.junit.After;
import org.junit.Assert; import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.ArgumentMatcher; import org.mockito.ArgumentMatcher;
import org.mockito.Mock; import org.mockito.Mock;
import org.mockito.MockitoAnnotations; import org.mockito.MockitoAnnotations;
import org.chromium.base.annotations.CalledByNative;
import org.chromium.base.annotations.CalledByNativeJavaTest;
import org.chromium.base.task.TaskRunner; import org.chromium.base.task.TaskRunner;
import org.chromium.base.test.BaseJUnit4ClassRunner;
import org.chromium.base.test.UiThreadTest;
import org.chromium.base.test.util.Batch;
import org.chromium.base.test.util.Feature; import org.chromium.base.test.util.Feature;
import org.chromium.chrome.browser.tab.Tab; import org.chromium.chrome.browser.tab.Tab;
import org.chromium.chrome.browser.tab.TabImpl; import org.chromium.chrome.browser.tab.TabImpl;
...@@ -43,7 +36,6 @@ import org.chromium.chrome.browser.tabmodel.TabPersistentStore.TabPersistentStor ...@@ -43,7 +36,6 @@ import org.chromium.chrome.browser.tabmodel.TabPersistentStore.TabPersistentStor
import org.chromium.chrome.browser.tabmodel.TabPersistentStore.TabRestoreDetails; import org.chromium.chrome.browser.tabmodel.TabPersistentStore.TabRestoreDetails;
import org.chromium.components.embedder_support.util.UrlConstants; import org.chromium.components.embedder_support.util.UrlConstants;
import org.chromium.content_public.browser.LoadUrlParams; import org.chromium.content_public.browser.LoadUrlParams;
import org.chromium.content_public.browser.test.NativeLibraryTestUtils;
import org.chromium.content_public.browser.test.util.CriteriaHelper; import org.chromium.content_public.browser.test.util.CriteriaHelper;
import java.io.IOException; import java.io.IOException;
...@@ -53,8 +45,6 @@ import java.util.concurrent.atomic.AtomicBoolean; ...@@ -53,8 +45,6 @@ import java.util.concurrent.atomic.AtomicBoolean;
/** /**
* Unit tests for the tab persistent store logic. * Unit tests for the tab persistent store logic.
*/ */
@RunWith(BaseJUnit4ClassRunner.class)
@Batch(Batch.UNIT_TESTS)
public class TabPersistentStoreUnitTest { public class TabPersistentStoreUnitTest {
private static final Integer REGULAR_TAB_ID_1 = 1; private static final Integer REGULAR_TAB_ID_1 = 1;
private static final Integer INCOGNITO_TAB_ID_1 = 21; private static final Integer INCOGNITO_TAB_ID_1 = 21;
...@@ -91,12 +81,13 @@ public class TabPersistentStoreUnitTest { ...@@ -91,12 +81,13 @@ public class TabPersistentStoreUnitTest {
private TabPersistentStore mPersistentStore; private TabPersistentStore mPersistentStore;
@Before @CalledByNative
private TabPersistentStoreUnitTest() {}
@CalledByNative
public void setUp() { public void setUp() {
MockitoAnnotations.initMocks(this); MockitoAnnotations.initMocks(this);
NativeLibraryTestUtils.loadNativeLibraryNoBrowserProcess();
when(mIncognitoTabModel.isIncognito()).thenReturn(true); when(mIncognitoTabModel.isIncognito()).thenReturn(true);
when(mTabModelSelector.getModel(false)).thenReturn(mNormalTabModel); when(mTabModelSelector.getModel(false)).thenReturn(mNormalTabModel);
when(mTabModelSelector.getModel(true)).thenReturn(mIncognitoTabModel); when(mTabModelSelector.getModel(true)).thenReturn(mIncognitoTabModel);
...@@ -110,18 +101,17 @@ public class TabPersistentStoreUnitTest { ...@@ -110,18 +101,17 @@ public class TabPersistentStoreUnitTest {
when(mPersistencePolicy.performInitialization(any(TaskRunner.class))).thenReturn(false); when(mPersistencePolicy.performInitialization(any(TaskRunner.class))).thenReturn(false);
} }
@After @CalledByNative
public void tearDown() throws Exception { public void tearDown() throws Exception {
// Flush pending PersistentStore tasks. // Flush pending PersistentStore tasks.
final AtomicBoolean flushed = new AtomicBoolean(false); final AtomicBoolean flushed = new AtomicBoolean(false);
if (mPersistentStore != null) { if (mPersistentStore != null) {
mPersistentStore.getTaskRunnerForTests().postTask(() -> { flushed.set(true); }); mPersistentStore.getTaskRunnerForTests().postTask(() -> { flushed.set(true); });
CriteriaHelper.pollUiThread(() -> flushed.get()); CriteriaHelper.pollUiThreadNested(() -> flushed.get());
} }
} }
@Test @CalledByNativeJavaTest
@SmallTest
@Feature("TabPersistentStore") @Feature("TabPersistentStore")
public void testNtpSaveBehavior() { public void testNtpSaveBehavior() {
when(mNormalTabModel.index()).thenReturn(TabList.INVALID_TAB_INDEX); when(mNormalTabModel.index()).thenReturn(TabList.INVALID_TAB_INDEX);
...@@ -172,8 +162,7 @@ public class TabPersistentStoreUnitTest { ...@@ -172,8 +162,7 @@ public class TabPersistentStoreUnitTest {
assertTrue(mPersistentStore.isTabPendingSave(ntpWithAllTheNavsTab)); assertTrue(mPersistentStore.isTabPendingSave(ntpWithAllTheNavsTab));
} }
@Test @CalledByNativeJavaTest
@SmallTest
@Feature("TabPersistentStore") @Feature("TabPersistentStore")
public void testNotActiveEmptyNtpIgnoredDuringRestore() { public void testNotActiveEmptyNtpIgnoredDuringRestore() {
mPersistentStore = new TabPersistentStore( mPersistentStore = new TabPersistentStore(
...@@ -187,8 +176,7 @@ public class TabPersistentStoreUnitTest { ...@@ -187,8 +176,7 @@ public class TabPersistentStoreUnitTest {
verifyZeroInteractions(mNormalTabCreator); verifyZeroInteractions(mNormalTabCreator);
} }
@Test @CalledByNativeJavaTest
@SmallTest
@Feature("TabPersistentStore") @Feature("TabPersistentStore")
public void testActiveEmptyNtpNotIgnoredDuringRestore() { public void testActiveEmptyNtpNotIgnoredDuringRestore() {
when(mTabModelSelector.isIncognitoSelected()).thenReturn(false); when(mTabModelSelector.isIncognitoSelected()).thenReturn(false);
...@@ -213,8 +201,7 @@ public class TabPersistentStoreUnitTest { ...@@ -213,8 +201,7 @@ public class TabPersistentStoreUnitTest {
eq(TabLaunchType.FROM_RESTORE), (Tab) isNull()); eq(TabLaunchType.FROM_RESTORE), (Tab) isNull());
} }
@Test @CalledByNativeJavaTest
@SmallTest
@Feature("TabPersistentStore") @Feature("TabPersistentStore")
public void testNtpFromMergeWithNoStateNotIgnoredDuringMerge() { public void testNtpFromMergeWithNoStateNotIgnoredDuringMerge() {
when(mTabModelSelector.isIncognitoSelected()).thenReturn(false); when(mTabModelSelector.isIncognitoSelected()).thenReturn(false);
...@@ -245,8 +232,7 @@ public class TabPersistentStoreUnitTest { ...@@ -245,8 +232,7 @@ public class TabPersistentStoreUnitTest {
eq(TabLaunchType.FROM_RESTORE), (Tab) isNull()); eq(TabLaunchType.FROM_RESTORE), (Tab) isNull());
} }
@Test @CalledByNativeJavaTest
@SmallTest
@Feature("TabPersistentStore") @Feature("TabPersistentStore")
public void testNtpWithStateNotIgnoredDuringRestore() { public void testNtpWithStateNotIgnoredDuringRestore() {
mPersistentStore = new TabPersistentStore( mPersistentStore = new TabPersistentStore(
...@@ -261,8 +247,7 @@ public class TabPersistentStoreUnitTest { ...@@ -261,8 +247,7 @@ public class TabPersistentStoreUnitTest {
verify(mNormalTabCreator).createFrozenTab(eq(ntpState), eq(1), anyInt()); verify(mNormalTabCreator).createFrozenTab(eq(ntpState), eq(1), anyInt());
} }
@Test @CalledByNativeJavaTest
@SmallTest
@Feature("TabPersistentStore") @Feature("TabPersistentStore")
public void testActiveEmptyIncognitoNtpNotIgnoredDuringRestore() { public void testActiveEmptyIncognitoNtpNotIgnoredDuringRestore() {
when(mTabModelSelector.isIncognitoSelected()).thenReturn(true); when(mTabModelSelector.isIncognitoSelected()).thenReturn(true);
...@@ -287,8 +272,7 @@ public class TabPersistentStoreUnitTest { ...@@ -287,8 +272,7 @@ public class TabPersistentStoreUnitTest {
eq(TabLaunchType.FROM_RESTORE), (Tab) isNull()); eq(TabLaunchType.FROM_RESTORE), (Tab) isNull());
} }
@Test @CalledByNativeJavaTest
@SmallTest
@Feature("TabPersistentStore") @Feature("TabPersistentStore")
public void testNotActiveIncognitoNtpIgnoredDuringRestore() { public void testNotActiveIncognitoNtpIgnoredDuringRestore() {
mPersistentStore = new TabPersistentStore( mPersistentStore = new TabPersistentStore(
...@@ -302,8 +286,7 @@ public class TabPersistentStoreUnitTest { ...@@ -302,8 +286,7 @@ public class TabPersistentStoreUnitTest {
verifyZeroInteractions(mIncognitoTabCreator); verifyZeroInteractions(mIncognitoTabCreator);
} }
@Test @CalledByNativeJavaTest
@SmallTest
@Feature("TabPersistentStore") @Feature("TabPersistentStore")
public void testActiveEmptyIncognitoNtpIgnoredDuringRestoreIfIncognitoLoadingIsDisabled() { public void testActiveEmptyIncognitoNtpIgnoredDuringRestoreIfIncognitoLoadingIsDisabled() {
mPersistentStore = new TabPersistentStore( mPersistentStore = new TabPersistentStore(
...@@ -317,9 +300,7 @@ public class TabPersistentStoreUnitTest { ...@@ -317,9 +300,7 @@ public class TabPersistentStoreUnitTest {
verifyZeroInteractions(mIncognitoTabCreator); verifyZeroInteractions(mIncognitoTabCreator);
} }
@Test @CalledByNativeJavaTest
@SmallTest
@UiThreadTest
@Feature("TabPersistentStore") @Feature("TabPersistentStore")
public void testSerializeTabModelSelector() throws IOException { public void testSerializeTabModelSelector() throws IOException {
setupSerializationTestMocks(); setupSerializationTestMocks();
...@@ -342,9 +323,7 @@ public class TabPersistentStoreUnitTest { ...@@ -342,9 +323,7 @@ public class TabPersistentStoreUnitTest {
metadata.incognitoModelMetadata.urls.get(1)); metadata.incognitoModelMetadata.urls.get(1));
} }
@Test @CalledByNativeJavaTest
@SmallTest
@UiThreadTest
@Feature("TabPersistentStore") @Feature("TabPersistentStore")
public void testSerializeTabModelSelector_tabsBeingRestored() throws IOException { public void testSerializeTabModelSelector_tabsBeingRestored() throws IOException {
setupSerializationTestMocks(); setupSerializationTestMocks();
......
...@@ -9,33 +9,22 @@ import static org.mockito.Mockito.doReturn; ...@@ -9,33 +9,22 @@ import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.spy; import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.when; import static org.mockito.Mockito.when;
import androidx.test.filters.SmallTest;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock; import org.mockito.Mock;
import org.mockito.MockitoAnnotations; import org.mockito.MockitoAnnotations;
import org.chromium.base.ContextUtils; import org.chromium.base.ContextUtils;
import org.chromium.base.test.BaseJUnit4ClassRunner; import org.chromium.base.annotations.CalledByNative;
import org.chromium.base.test.UiThreadTest; import org.chromium.base.annotations.CalledByNativeJavaTest;
import org.chromium.base.test.util.Batch;
import org.chromium.base.test.util.JniMocker;
import org.chromium.chrome.R; import org.chromium.chrome.R;
import org.chromium.chrome.browser.omnibox.LocationBarLayout; import org.chromium.chrome.browser.omnibox.LocationBarLayout;
import org.chromium.chrome.browser.tab.TabImpl; import org.chromium.chrome.browser.tab.TabImpl;
import org.chromium.components.security_state.ConnectionSecurityLevel; import org.chromium.components.security_state.ConnectionSecurityLevel;
import org.chromium.components.security_state.SecurityStateModel; import org.chromium.components.security_state.SecurityStateModel;
import org.chromium.components.security_state.SecurityStateModelJni; import org.chromium.components.security_state.SecurityStateModelJni;
import org.chromium.content_public.browser.test.NativeLibraryTestUtils;
/** /**
* Unit tests for {@link LocationBarLayout} class. * Unit tests for {@link LocationBarLayout} class.
*/ */
@RunWith(BaseJUnit4ClassRunner.class)
@Batch(Batch.UNIT_TESTS)
public final class ToolbarSecurityIconTest { public final class ToolbarSecurityIconTest {
private static final boolean IS_SMALL_DEVICE = true; private static final boolean IS_SMALL_DEVICE = true;
private static final boolean IS_OFFLINE_PAGE = true; private static final boolean IS_OFFLINE_PAGE = true;
...@@ -45,9 +34,6 @@ public final class ToolbarSecurityIconTest { ...@@ -45,9 +34,6 @@ public final class ToolbarSecurityIconTest {
new int[] {ConnectionSecurityLevel.NONE, ConnectionSecurityLevel.WARNING, new int[] {ConnectionSecurityLevel.NONE, ConnectionSecurityLevel.WARNING,
ConnectionSecurityLevel.DANGEROUS, ConnectionSecurityLevel.SECURE}; ConnectionSecurityLevel.DANGEROUS, ConnectionSecurityLevel.SECURE};
@Rule
public JniMocker mocker = new JniMocker();
@Mock @Mock
private TabImpl mTab; private TabImpl mTab;
@Mock @Mock
...@@ -56,20 +42,23 @@ public final class ToolbarSecurityIconTest { ...@@ -56,20 +42,23 @@ public final class ToolbarSecurityIconTest {
@Mock @Mock
private LocationBarModel mLocationBarModel; private LocationBarModel mLocationBarModel;
@Before @CalledByNative
private ToolbarSecurityIconTest() {}
@CalledByNative
public void setUp() { public void setUp() {
MockitoAnnotations.initMocks(this); MockitoAnnotations.initMocks(this);
SecurityStateModelJni.TEST_HOOKS.setInstanceForTesting(mSecurityStateMocks);
NativeLibraryTestUtils.loadNativeLibraryNoBrowserProcess();
mocker.mock(SecurityStateModelJni.TEST_HOOKS, mSecurityStateMocks);
mLocationBarModel = spy(new LocationBarModel(ContextUtils.getApplicationContext())); mLocationBarModel = spy(new LocationBarModel(ContextUtils.getApplicationContext()));
mLocationBarModel.initializeWithNative(); mLocationBarModel.initializeWithNative();
} }
@Test @CalledByNative
@SmallTest public void tearDown() {
@UiThreadTest SecurityStateModelJni.TEST_HOOKS.setInstanceForTesting(null);
}
@CalledByNativeJavaTest
public void testGetSecurityLevel() { public void testGetSecurityLevel() {
assertEquals(ConnectionSecurityLevel.NONE, assertEquals(ConnectionSecurityLevel.NONE,
mLocationBarModel.getSecurityLevel(null, !IS_OFFLINE_PAGE, null)); mLocationBarModel.getSecurityLevel(null, !IS_OFFLINE_PAGE, null));
...@@ -102,9 +91,7 @@ public final class ToolbarSecurityIconTest { ...@@ -102,9 +91,7 @@ public final class ToolbarSecurityIconTest {
mLocationBarModel.getSecurityLevel(mTab, !IS_OFFLINE_PAGE, null)); mLocationBarModel.getSecurityLevel(mTab, !IS_OFFLINE_PAGE, null));
} }
@Test @CalledByNativeJavaTest
@SmallTest
@UiThreadTest
public void testGetSecurityIconResource() { public void testGetSecurityIconResource() {
when(mSecurityStateMocks.shouldShowDangerTriangleForWarningLevel()).thenReturn(false); when(mSecurityStateMocks.shouldShowDangerTriangleForWarningLevel()).thenReturn(false);
for (int securityLevel : SECURITY_LEVELS) { for (int securityLevel : SECURITY_LEVELS) {
...@@ -181,9 +168,7 @@ public final class ToolbarSecurityIconTest { ...@@ -181,9 +168,7 @@ public final class ToolbarSecurityIconTest {
!IS_SMALL_DEVICE, !IS_OFFLINE_PAGE, !IS_PREVIEW, !IS_PAINT_PREVIEW)); !IS_SMALL_DEVICE, !IS_OFFLINE_PAGE, !IS_PREVIEW, !IS_PAINT_PREVIEW));
} }
@Test @CalledByNativeJavaTest
@SmallTest
@UiThreadTest
public void testGetSecurityIconResourceForMarkHttpAsDangerWarning() { public void testGetSecurityIconResourceForMarkHttpAsDangerWarning() {
when(mSecurityStateMocks.shouldShowDangerTriangleForWarningLevel()).thenReturn(false); when(mSecurityStateMocks.shouldShowDangerTriangleForWarningLevel()).thenReturn(false);
assertEquals(0, assertEquals(0,
......
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/android/jni_android.h"
#include "chrome/android/native_j_unittests_jni_headers/ChromeContextMenuPopulatorTest_jni.h"
#include "testing/gtest/include/gtest/gtest.h"
using base::android::AttachCurrentThread;
class ChromeContextMenuPopulatorTest : public ::testing::Test {
public:
ChromeContextMenuPopulatorTest()
: j_test_(Java_ChromeContextMenuPopulatorTest_Constructor(
AttachCurrentThread())) {}
void SetUp() override {
Java_ChromeContextMenuPopulatorTest_setUp(AttachCurrentThread(), j_test_);
}
const base::android::ScopedJavaGlobalRef<jobject>& j_test() {
return j_test_;
}
private:
base::android::ScopedJavaGlobalRef<jobject> j_test_;
};
JAVA_TESTS(ChromeContextMenuPopulatorTest, j_test())
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/android/jni_android.h"
#include "chrome/android/native_j_unittests_jni_headers/InstalledAppProviderTest_jni.h"
#include "testing/gtest/include/gtest/gtest.h"
using base::android::AttachCurrentThread;
class InstalledAppProviderTest : public ::testing::Test {
public:
InstalledAppProviderTest()
: j_test_(
Java_InstalledAppProviderTest_Constructor(AttachCurrentThread())) {}
void SetUp() override {
Java_InstalledAppProviderTest_setUp(AttachCurrentThread(), j_test_);
}
void TearDown() override {
Java_InstalledAppProviderTest_tearDown(AttachCurrentThread(), j_test_);
}
const base::android::ScopedJavaGlobalRef<jobject>& j_test() {
return j_test_;
}
private:
base::android::ScopedJavaGlobalRef<jobject> j_test_;
};
JAVA_TESTS(InstalledAppProviderTest, j_test())
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/android/jni_android.h"
#include "chrome/android/native_j_unittests_jni_headers/NotificationPlatformBridgeUnitTest_jni.h"
#include "testing/gtest/include/gtest/gtest.h"
using base::android::AttachCurrentThread;
class NotificationPlatformBridgeUnitTest : public ::testing::Test {
public:
NotificationPlatformBridgeUnitTest()
: j_test_(Java_NotificationPlatformBridgeUnitTest_Constructor(
AttachCurrentThread())) {}
const base::android::ScopedJavaGlobalRef<jobject>& j_test() {
return j_test_;
}
private:
base::android::ScopedJavaGlobalRef<jobject> j_test_;
};
JAVA_TESTS(NotificationPlatformBridgeUnitTest, j_test())
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/android/jni_android.h"
#include "chrome/android/native_j_unittests_jni_headers/PartnerBrowserCustomizationsUnitTest_jni.h"
#include "testing/gtest/include/gtest/gtest.h"
using base::android::AttachCurrentThread;
class PartnerBrowserCustomizationsUnitTest : public ::testing::Test {
public:
PartnerBrowserCustomizationsUnitTest()
: j_test_(Java_PartnerBrowserCustomizationsUnitTest_Constructor(
AttachCurrentThread())) {}
const base::android::ScopedJavaGlobalRef<jobject>& j_test() {
return j_test_;
}
private:
base::android::ScopedJavaGlobalRef<jobject> j_test_;
};
JAVA_TESTS(PartnerBrowserCustomizationsUnitTest, j_test())
...@@ -80,9 +80,15 @@ source_set("unittests") { ...@@ -80,9 +80,15 @@ source_set("unittests") {
] ]
if (is_android) { if (is_android) {
sources += [ "android/payment_app_service_bridge_unittest.cc" ] sources += [
"android/android_payment_app_finder_unittest.cc",
"android/android_payment_app_unittest.cc",
"android/payment_app_service_bridge_unittest.cc",
"android/payment_manifest_verifier_unittest.cc",
]
deps += [ deps += [
"//chrome/android:native_j_unittests_jni_headers",
"//components/payments/content", "//components/payments/content",
"//components/payments/content:utils", "//components/payments/content:utils",
] ]
......
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/android/jni_android.h"
#include "chrome/android/native_j_unittests_jni_headers/AndroidPaymentAppFinderUnitTest_jni.h"
#include "testing/gtest/include/gtest/gtest.h"
using base::android::AttachCurrentThread;
class AndroidPaymentAppFinderUnitTest : public ::testing::Test {
public:
AndroidPaymentAppFinderUnitTest()
: j_test_(Java_AndroidPaymentAppFinderUnitTest_Constructor(
AttachCurrentThread())) {}
const base::android::ScopedJavaGlobalRef<jobject>& j_test() {
return j_test_;
}
private:
base::android::ScopedJavaGlobalRef<jobject> j_test_;
};
JAVA_TESTS(AndroidPaymentAppFinderUnitTest, j_test())
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/android/jni_android.h"
#include "chrome/android/native_j_unittests_jni_headers/AndroidPaymentAppUnitTest_jni.h"
#include "testing/gtest/include/gtest/gtest.h"
class AndroidPaymentAppUnitTest : public ::testing::Test {
public:
AndroidPaymentAppUnitTest()
: j_test_(Java_AndroidPaymentAppUnitTest_Constructor(
base::android::AttachCurrentThread())) {}
const base::android::ScopedJavaGlobalRef<jobject>& j_test() {
return j_test_;
}
private:
base::android::ScopedJavaGlobalRef<jobject> j_test_;
};
JAVA_TESTS(AndroidPaymentAppUnitTest, j_test())
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/android/jni_android.h"
#include "chrome/android/native_j_unittests_jni_headers/PaymentManifestVerifierTest_jni.h"
#include "testing/gtest/include/gtest/gtest.h"
using base::android::AttachCurrentThread;
class PaymentManifestVerifierTest : public ::testing::Test {
public:
PaymentManifestVerifierTest()
: j_test_(Java_PaymentManifestVerifierTest_Constructor(
AttachCurrentThread())) {}
const base::android::ScopedJavaGlobalRef<jobject>& j_test() {
return j_test_;
}
private:
base::android::ScopedJavaGlobalRef<jobject> j_test_;
};
JAVA_TESTS(PaymentManifestVerifierTest, j_test())
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/android/jni_android.h"
#include "chrome/android/native_j_unittests_jni_headers/TabPersistentStoreUnitTest_jni.h"
#include "testing/gtest/include/gtest/gtest.h"
using base::android::AttachCurrentThread;
class TabPersistentStoreUnitTest : public ::testing::Test {
public:
TabPersistentStoreUnitTest()
: j_test_(Java_TabPersistentStoreUnitTest_Constructor(
AttachCurrentThread())) {}
void SetUp() override {
Java_TabPersistentStoreUnitTest_setUp(AttachCurrentThread(), j_test_);
}
void TearDown() override {
Java_TabPersistentStoreUnitTest_tearDown(AttachCurrentThread(), j_test_);
}
const base::android::ScopedJavaGlobalRef<jobject>& j_test() {
return j_test_;
}
private:
base::android::ScopedJavaGlobalRef<jobject> j_test_;
};
JAVA_TESTS(TabPersistentStoreUnitTest, j_test())
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/android/jni_android.h"
#include "chrome/android/native_j_unittests_jni_headers/ToolbarSecurityIconTest_jni.h"
#include "testing/gtest/include/gtest/gtest.h"
using base::android::AttachCurrentThread;
class ToolbarSecurityIconTest : public ::testing::Test {
public:
ToolbarSecurityIconTest()
: j_test_(
Java_ToolbarSecurityIconTest_Constructor(AttachCurrentThread())) {}
void SetUp() override {
Java_ToolbarSecurityIconTest_setUp(AttachCurrentThread(), j_test_);
}
void TearDown() override {
Java_ToolbarSecurityIconTest_tearDown(AttachCurrentThread(), j_test_);
}
const base::android::ScopedJavaGlobalRef<jobject>& j_test() {
return j_test_;
}
private:
base::android::ScopedJavaGlobalRef<jobject> j_test_;
};
JAVA_TESTS(ToolbarSecurityIconTest, j_test())
...@@ -4032,11 +4032,15 @@ test("unit_tests") { ...@@ -4032,11 +4032,15 @@ test("unit_tests") {
"../browser/autofill/autofill_save_card_infobar_delegate_mobile_unittest.cc", "../browser/autofill/autofill_save_card_infobar_delegate_mobile_unittest.cc",
"../browser/autofill/credit_card_accessory_controller_impl_unittest.cc", "../browser/autofill/credit_card_accessory_controller_impl_unittest.cc",
"../browser/autofill/manual_filling_controller_impl_unittest.cc", "../browser/autofill/manual_filling_controller_impl_unittest.cc",
"../browser/contextmenu/chrome_context_menu_populator_unittest.cc",
"../browser/installedapp/installed_app_provider_unittest.cc",
"../browser/media/android/cdm/media_drm_origin_id_manager_unittest.cc", "../browser/media/android/cdm/media_drm_origin_id_manager_unittest.cc",
"../browser/metrics/chrome_android_metrics_provider_unittest.cc", "../browser/metrics/chrome_android_metrics_provider_unittest.cc",
"../browser/notifications/notification_platform_bridge_android_unittest.cc",
"../browser/offline_pages/prefetch/notifications/prefetch_notification_service_impl_unittest.cc", "../browser/offline_pages/prefetch/notifications/prefetch_notification_service_impl_unittest.cc",
"../browser/optimization_guide/android/optimization_guide_bridge_unittest.cc", "../browser/optimization_guide/android/optimization_guide_bridge_unittest.cc",
"../browser/page_load_metrics/observers/android_page_load_metrics_observer_unittest.cc", "../browser/page_load_metrics/observers/android_page_load_metrics_observer_unittest.cc",
"../browser/partnercustomizations/partner_browser_customizations_unittest.cc",
"../browser/password_manager/android/account_chooser_dialog_android_unittest.cc", "../browser/password_manager/android/account_chooser_dialog_android_unittest.cc",
"../browser/password_manager/android/all_passwords_bottom_sheet_controller_unittest.cc", "../browser/password_manager/android/all_passwords_bottom_sheet_controller_unittest.cc",
"../browser/password_manager/android/auto_signin_first_run_dialog_android_unittest.cc", "../browser/password_manager/android/auto_signin_first_run_dialog_android_unittest.cc",
...@@ -4046,6 +4050,8 @@ test("unit_tests") { ...@@ -4046,6 +4050,8 @@ test("unit_tests") {
"../browser/password_manager/android/save_password_infobar_delegate_android_unittest.cc", "../browser/password_manager/android/save_password_infobar_delegate_android_unittest.cc",
"../browser/password_manager/android/update_password_infobar_delegate_android_unittest.cc", "../browser/password_manager/android/update_password_infobar_delegate_android_unittest.cc",
"../browser/permissions/permission_prompt_android_unittest.cc", "../browser/permissions/permission_prompt_android_unittest.cc",
"../browser/tabmodel/tab_persistent_store_unittest.cc",
"../browser/toolbar/toolbar_security_icon_unittest.cc",
"../browser/touch_to_fill/touch_to_fill_controller_unittest.cc", "../browser/touch_to_fill/touch_to_fill_controller_unittest.cc",
"../browser/translate/translate_manager_render_view_host_android_unittest.cc", "../browser/translate/translate_manager_render_view_host_android_unittest.cc",
] ]
...@@ -4055,6 +4061,8 @@ test("unit_tests") { ...@@ -4055,6 +4061,8 @@ test("unit_tests") {
"//chrome:chrome_android_core", "//chrome:chrome_android_core",
"//chrome/android:app_hooks_java", "//chrome/android:app_hooks_java",
"//chrome/android:chrome_java", "//chrome/android:chrome_java",
"//chrome/android:native_j_unittests_jni_headers",
"//chrome/android:native_java_unittests_java",
"//chrome/android/features/media_router:java", "//chrome/android/features/media_router:java",
"//chrome/browser/optimization_guide/android:native_j_unittests_jni_headers", "//chrome/browser/optimization_guide/android:native_j_unittests_jni_headers",
"//chrome/browser/optimization_guide/android:native_java_unittests", "//chrome/browser/optimization_guide/android:native_java_unittests",
......
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