Skip to content

Commit

Permalink
Rename DummyUiActivity to BlankUiTestActivity
Browse files Browse the repository at this point in the history
This CL renames the DummyUiActivity class to BlankUiTestActivity.

Per Google's documentation and style guidelines, the words "dummy" and
"dumb down" should be avoided. For this reason we are replacing the
DummyUiActivity with the more appropriately named BlankUiTestActivity.
We also make the following renames:

DummyUiActivityTestRule -> BlankUiTestActivityTestRule
DummySettingsForTest -> PlaceholderSettingsForTest

This CL also makes updates to comments and method names where needed
to match these changes.

Bug: 1295312
Change-Id: Ib712a292e0dcee32a97e9d7c487af2fb920f5084
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3445111
Reviewed-by: Ted Choc <[email protected]>
Reviewed-by: Theresa Sullivan <[email protected]>
Reviewed-by: Yaron Friedman <[email protected]>
Reviewed-by: Michael Thiessen <[email protected]>
Commit-Queue: Mark Schillaci <[email protected]>
Cr-Commit-Position: refs/heads/main@{#969056}
  • Loading branch information
mschillaci authored and Chromium LUCI CQ committed Feb 9, 2022
1 parent b81eced commit e1d37e7
Show file tree
Hide file tree
Showing 126 changed files with 352 additions and 353 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
import org.chromium.ui.modelutil.LazyConstructionPropertyMcp;
import org.chromium.ui.modelutil.ListModel;
import org.chromium.ui.modelutil.PropertyModel;
import org.chromium.ui.test.util.DummyUiActivity;
import org.chromium.ui.test.util.BlankUiTestActivity;
import org.chromium.ui.test.util.NightModeTestUtils;
import org.chromium.ui.test.util.ViewUtils;

Expand All @@ -94,8 +94,8 @@ public class AccessorySheetRenderTest {

// No @Rule since we only need the launching helpers. Adding the rule to the chain breaks with
// any ParameterizedRunnerDelegate.
private BaseActivityTestRule<DummyUiActivity> mActivityTestRule =
new BaseActivityTestRule<>(DummyUiActivity.class);
private BaseActivityTestRule<BlankUiTestActivity> mActivityTestRule =
new BaseActivityTestRule<>(BlankUiTestActivity.class);

@Rule
public final ChromeRenderTestRule mRenderTestRule =
Expand All @@ -105,7 +105,7 @@ public AccessorySheetRenderTest(boolean nightModeEnabled, boolean useRtlLayout)
FeatureList.setTestFeatures(
Collections.singletonMap(ChromeFeatureList.AUTOFILL_KEYBOARD_ACCESSORY, true));
setRtlForTesting(useRtlLayout);
NightModeTestUtils.setUpNightModeForDummyUiActivity(nightModeEnabled);
NightModeTestUtils.setUpNightModeForBlankUiTestActivity(nightModeEnabled);
mRenderTestRule.setNightModeEnabled(nightModeEnabled);
mRenderTestRule.setVariantPrefix(useRtlLayout ? "RTL" : "LTR");
}
Expand Down Expand Up @@ -144,7 +144,7 @@ public void setUp() throws InterruptedException {

@After
public void tearDown() {
NightModeTestUtils.tearDownNightModeForDummyUiActivity();
NightModeTestUtils.tearDownNightModeForBlankUiTestActivity();
setRtlForTesting(false);
try {
ApplicationTestUtils.finishActivity(mActivityTestRule.getActivity());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@
import org.chromium.chrome.test.ChromeJUnit4ClassRunner;
import org.chromium.ui.modelutil.ListModel;
import org.chromium.ui.modelutil.PropertyModel;
import org.chromium.ui.test.util.DummyUiActivity;
import org.chromium.ui.test.util.DummyUiActivityTestCase;
import org.chromium.ui.test.util.BlankUiTestActivity;
import org.chromium.ui.test.util.BlankUiTestActivityTestCase;

/**
* View tests for the keyboard accessory tab layout component.
*/
@RunWith(ChromeJUnit4ClassRunner.class)
@CommandLineFlags.Add({ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE})
public class KeyboardAccessoryTabLayoutViewTest extends DummyUiActivityTestCase {
public class KeyboardAccessoryTabLayoutViewTest extends BlankUiTestActivityTestCase {
private PropertyModel mModel;
private KeyboardAccessoryTabLayoutView mView;

Expand All @@ -60,7 +60,7 @@ private CharSequence getTabDescriptionAt(int position) {

@BeforeClass
public static void setUpBeforeActivityLaunched() {
DummyUiActivity.setTestLayout(R.layout.keyboard_accessory_tabs);
BlankUiTestActivity.setTestLayout(R.layout.keyboard_accessory_tabs);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@
import org.chromium.chrome.test.ChromeJUnit4ClassRunner;
import org.chromium.content_public.browser.test.util.TestThreadUtils;
import org.chromium.ui.modelutil.PropertyModel;
import org.chromium.ui.test.util.DummyUiActivityTestCase;
import org.chromium.ui.test.util.BlankUiTestActivityTestCase;

import java.util.concurrent.atomic.AtomicBoolean;

/** Tests for {@link BottomBarViewBinder}. */
@SuppressWarnings("ConstantConditions")
@RunWith(ChromeJUnit4ClassRunner.class)
public class BottomBarViewBinderTest extends DummyUiActivityTestCase {
public class BottomBarViewBinderTest extends BlankUiTestActivityTestCase {
@SuppressWarnings("unused")
private BottomBarCoordinator mBottomBarCoordinator;
private TabLayout mTabLayout;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ public class ExploreSurfaceViewBinderTest {
public void setUp() throws Exception {
mActivityTestRule.startMainActivityFromLauncher();

// TODO(crbug.com/1025296): Investigate to use DummyUiActivityTestCase. We can not do that
// since mocked FeedSurfaceCoordinator does not work as expected in release build (works
// well in debug build).
// TODO(crbug.com/1025296): Investigate to use BlankUiTestActivityTestCase. We can not do
// that since mocked FeedSurfaceCoordinator does not work as expected in release build
// (works well in debug build).
TestThreadUtils.runOnUiThreadBlocking(() -> {
mPropertyModel = new PropertyModel(StartSurfaceProperties.ALL_KEYS);
mExploreSurfaceCoordinatorFactory = new ExploreSurfaceCoordinatorFactory(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@
import org.chromium.content_public.browser.test.util.TestThreadUtils;
import org.chromium.ui.modelutil.PropertyModel;
import org.chromium.ui.modelutil.PropertyModelChangeProcessor;
import org.chromium.ui.test.util.DummyUiActivityTestCase;
import org.chromium.ui.test.util.BlankUiTestActivityTestCase;

/** Tests for {@link SecondaryTasksSurfaceViewBinder}. */
@RunWith(ChromeJUnit4ClassRunner.class)
public class SecondaryTasksSurfaceViewBinderTest extends DummyUiActivityTestCase {
public class SecondaryTasksSurfaceViewBinderTest extends BlankUiTestActivityTestCase {
private ViewGroup mParentView;
private View mTasksSurfaceView;
private View mTopToolbarPlaceholderView;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@
import org.chromium.content_public.browser.test.util.TestThreadUtils;
import org.chromium.ui.modelutil.PropertyModel;
import org.chromium.ui.modelutil.PropertyModelChangeProcessor;
import org.chromium.ui.test.util.DummyUiActivityTestCase;
import org.chromium.ui.test.util.BlankUiTestActivityTestCase;

/** Tests for {@link TasksSurfaceViewBinder}. */
@RunWith(ChromeJUnit4ClassRunner.class)
public class TasksSurfaceViewBinderTest extends DummyUiActivityTestCase {
public class TasksSurfaceViewBinderTest extends BlankUiTestActivityTestCase {
private ViewGroup mParentView;
private ViewGroup mTasksSurfaceView;
private View mTopToolbarPlaceholderView;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@
import org.chromium.content_public.browser.test.util.TestThreadUtils;
import org.chromium.ui.modelutil.PropertyModel;
import org.chromium.ui.modelutil.PropertyModelChangeProcessor;
import org.chromium.ui.test.util.DummyUiActivityTestCase;
import org.chromium.ui.test.util.BlankUiTestActivityTestCase;

/** Tests for {@link SingleTabViewBinder}. */
@RunWith(ChromeJUnit4ClassRunner.class)
public class SingleTabViewBinderTest extends DummyUiActivityTestCase {
public class SingleTabViewBinderTest extends BlankUiTestActivityTestCase {
private SingleTabView mSingleTabView;
private PropertyModelChangeProcessor mPropertyModelChangeProcessor;
private PropertyModel mPropertyModel;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,13 @@
import org.chromium.content_public.browser.test.util.TestThreadUtils;
import org.chromium.ui.modelutil.PropertyModel;
import org.chromium.ui.modelutil.PropertyModelChangeProcessor;
import org.chromium.ui.test.util.DummyUiActivityTestCase;
import org.chromium.ui.test.util.BlankUiTestActivityTestCase;

import java.util.concurrent.atomic.AtomicBoolean;

/** Tests for {@link TasksViewBinder}. */
@RunWith(ChromeJUnit4ClassRunner.class)
public class TasksViewBinderTest extends DummyUiActivityTestCase {
public class TasksViewBinderTest extends BlankUiTestActivityTestCase {
private TasksView mTasksView;
private PropertyModel mTasksViewPropertyModel;
private AtomicBoolean mViewClicked = new AtomicBoolean();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import org.chromium.content_public.browser.test.util.TestThreadUtils;
import org.chromium.ui.modelutil.PropertyModel;
import org.chromium.ui.modelutil.PropertyModelChangeProcessor;
import org.chromium.ui.test.util.DummyUiActivityTestCase;
import org.chromium.ui.test.util.BlankUiTestActivityTestCase;
import org.chromium.ui.widget.ButtonCompat;
import org.chromium.ui.widget.ChromeImageView;

Expand All @@ -38,7 +38,7 @@
* Tests for {@link LargeMessageCardViewBinder}.
*/
@RunWith(ChromeJUnit4ClassRunner.class)
public class LargeMessageCardViewBinderTest extends DummyUiActivityTestCase {
public class LargeMessageCardViewBinderTest extends BlankUiTestActivityTestCase {
private static final String TITLE_TEXT = "titleText";
private static final String ACTION_TEXT = "actionText";
private static final String DESCRIPTION_TEXT = "descriptionText";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
import org.chromium.ui.modelutil.LayoutViewBuilder;
import org.chromium.ui.modelutil.MVCListAdapter;
import org.chromium.ui.modelutil.SimpleRecyclerViewAdapter;
import org.chromium.ui.test.util.DummyUiActivityTestCase;
import org.chromium.ui.test.util.BlankUiTestActivityTestCase;

import java.util.List;
import java.util.concurrent.atomic.AtomicBoolean;
Expand All @@ -45,7 +45,7 @@
* Integration tests for MessageCardProvider component.
*/
@Features.DisableFeatures(ChromeFeatureList.TAB_TO_GTS_ANIMATION)
public class MessageCardProviderTest extends DummyUiActivityTestCase {
public class MessageCardProviderTest extends BlankUiTestActivityTestCase {
private static final int SUGGESTED_TAB_COUNT = 2;

@Rule
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@
import org.chromium.content_public.browser.test.util.TestThreadUtils;
import org.chromium.ui.modelutil.PropertyModel;
import org.chromium.ui.modelutil.PropertyModelChangeProcessor;
import org.chromium.ui.test.util.DummyUiActivityTestCase;
import org.chromium.ui.test.util.BlankUiTestActivityTestCase;

import java.util.concurrent.atomic.AtomicBoolean;

/**
* Tests for {@link MessageCardViewBinder}.
*/
@RunWith(ChromeJUnit4ClassRunner.class)
public class MessageCardViewBinderTest extends DummyUiActivityTestCase {
public class MessageCardViewBinderTest extends BlankUiTestActivityTestCase {
private static final String ACTION_TEXT = "actionText";
private static final String DESCRIPTION_TEXT = "descriptionText";
private static final String DISMISS_BUTTON_CONTENT_DESCRIPTION = "dismiss";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@
import org.chromium.chrome.test.ChromeJUnit4ClassRunner;
import org.chromium.components.browser_ui.widget.scrim.ScrimCoordinator;
import org.chromium.content_public.browser.test.util.TestThreadUtils;
import org.chromium.ui.test.util.DummyUiActivityTestCase;
import org.chromium.ui.test.util.BlankUiTestActivityTestCase;

import java.util.concurrent.atomic.AtomicReference;

/**
* DummyUiActivity Tests for the {@link TabGridDialogView}.
* BlankUiTestActivity Tests for the {@link TabGridDialogView}.
*/
@RunWith(ChromeJUnit4ClassRunner.class)
public class TabGridDialogViewTest extends DummyUiActivityTestCase {
public class TabGridDialogViewTest extends BlankUiTestActivityTestCase {
private int mToolbarHeight;
private int mTopMargin;
private int mSideMargin;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
import org.chromium.content_public.browser.test.util.TestThreadUtils;
import org.chromium.ui.modelutil.PropertyModel;
import org.chromium.ui.modelutil.PropertyModelChangeProcessor;
import org.chromium.ui.test.util.DummyUiActivityTestCase;
import org.chromium.ui.test.util.BlankUiTestActivityTestCase;
import org.chromium.ui.widget.ChromeImageView;

import java.util.concurrent.atomic.AtomicBoolean;
Expand All @@ -49,7 +49,7 @@
* Tests for {@link TabGridPanelViewBinder}.
*/
@RunWith(ChromeJUnit4ClassRunner.class)
public class TabGridPanelViewBinderTest extends DummyUiActivityTestCase {
public class TabGridPanelViewBinderTest extends BlankUiTestActivityTestCase {
private static final String TAG = "TGPVBT";
private static final int CONTENT_TOP_MARGIN = 56;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@
import org.chromium.content_public.browser.test.util.TestThreadUtils;
import org.chromium.ui.modelutil.PropertyModel;
import org.chromium.ui.modelutil.PropertyModelChangeProcessor;
import org.chromium.ui.test.util.DummyUiActivityTestCase;
import org.chromium.ui.test.util.BlankUiTestActivityTestCase;

import java.util.concurrent.atomic.AtomicBoolean;

/**
* Tests for {@link TabGroupUiViewBinder}.
*/
@RunWith(ChromeJUnit4ClassRunner.class)
public class TabGroupUiViewBinderTest extends DummyUiActivityTestCase {
public class TabGroupUiViewBinderTest extends BlankUiTestActivityTestCase {
private ImageView mLeftButton;
private ImageView mRightButton;
private ViewGroup mContainerView;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,17 @@
import org.chromium.content_public.browser.test.util.TestThreadUtils;
import org.chromium.ui.modelutil.PropertyModel;
import org.chromium.ui.modelutil.PropertyModelChangeProcessor;
import org.chromium.ui.test.util.DummyUiActivity;
import org.chromium.ui.test.util.DummyUiActivityTestCase;
import org.chromium.ui.test.util.BlankUiTestActivity;
import org.chromium.ui.test.util.BlankUiTestActivityTestCase;

/**
* Tests for {@link TabListRecyclerView} and {@link TabListContainerViewBinder}
*/
@RunWith(ChromeJUnit4ClassRunner.class)
@Features.EnableFeatures({ChromeFeatureList.TAB_GRID_LAYOUT_ANDROID})
public class TabListContainerViewBinderTest extends DummyUiActivityTestCase {
public class TabListContainerViewBinderTest extends BlankUiTestActivityTestCase {
/**
* DummyUiActivityTestCase also needs {@link ChromeFeatureList}'s
* BlankUiTestActivityTestCase also needs {@link ChromeFeatureList}'s
* internal test-only feature map, not the {@link CommandLine} provided by
* {@link Features.InstrumentationProcessor}.
*/
Expand Down Expand Up @@ -97,7 +97,7 @@ public void finishedHiding() {

@BeforeClass
public static void setUpBeforeActivityLaunched() {
DummyUiActivity.setTestLayout(R.layout.tab_list_recycler_view_layout);
BlankUiTestActivity.setTestLayout(R.layout.tab_list_recycler_view_layout);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
import org.chromium.content_public.browser.test.util.TestThreadUtils;
import org.chromium.ui.modelutil.PropertyModel;
import org.chromium.ui.modelutil.PropertyModelChangeProcessor;
import org.chromium.ui.test.util.DummyUiActivityTestCase;
import org.chromium.ui.test.util.BlankUiTestActivityTestCase;
import org.chromium.ui.widget.ButtonCompat;
import org.chromium.ui.widget.ChromeImageView;
import org.chromium.url.GURL;
Expand All @@ -96,7 +96,7 @@
@CommandLineFlags.Add({ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE,
"enable-features=" + ChromeFeatureList.COMMERCE_PRICE_TRACKING + "<Study",
"force-fieldtrials=Study/Group"})
public class TabListViewHolderTest extends DummyUiActivityTestCase {
public class TabListViewHolderTest extends BlankUiTestActivityTestCase {
@Rule
public JniMocker mMocker = new JniMocker();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
import org.chromium.content_public.browser.test.util.TestThreadUtils;
import org.chromium.ui.modelutil.PropertyModel;
import org.chromium.ui.modelutil.PropertyModelChangeProcessor;
import org.chromium.ui.test.util.DummyUiActivityTestCase;
import org.chromium.ui.test.util.BlankUiTestActivityTestCase;

import java.util.Arrays;
import java.util.HashSet;
Expand All @@ -42,7 +42,7 @@
*/
@SuppressWarnings("ArraysAsListWithZeroOrOneArgument")
@RunWith(ChromeJUnit4ClassRunner.class)
public class TabSelectionEditorLayoutBinderTest extends DummyUiActivityTestCase {
public class TabSelectionEditorLayoutBinderTest extends BlankUiTestActivityTestCase {
private TabSelectionEditorLayout mEditorLayoutView;
private PropertyModel mModel;
private PropertyModelChangeProcessor mMCP;
Expand Down
2 changes: 1 addition & 1 deletion chrome/android/javatests/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
<activity android:name="org.chromium.test.broker.OnDeviceInstrumentationBroker"
android:exported="true"/>

<activity android:name="org.chromium.ui.test.util.DummyUiActivity"
<activity android:name="org.chromium.ui.test.util.BlankUiTestActivity"
android:theme="@style/Theme.Chromium.Activity"
android:exported="true"/>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
import org.chromium.components.image_fetcher.ImageFetcher;
import org.chromium.components.payments.CurrencyFormatter;
import org.chromium.content_public.browser.test.util.TestThreadUtils;
import org.chromium.ui.test.util.DummyUiActivityTestCase;
import org.chromium.ui.test.util.BlankUiTestActivityTestCase;
import org.chromium.ui.test.util.NightModeTestUtils;
import org.chromium.ui.test.util.NightModeTestUtils.NightModeParams;

Expand All @@ -54,7 +54,7 @@
*/
@RunWith(ParameterizedRunner.class)
@ParameterAnnotations.UseRunnerDelegate(ChromeJUnit4RunnerDelegate.class)
public class PowerBookmarkShoppingItemRowRenderTest extends DummyUiActivityTestCase {
public class PowerBookmarkShoppingItemRowRenderTest extends BlankUiTestActivityTestCase {
@ParameterAnnotations.ClassParameter
private static List<ParameterSet> sClassParams = new NightModeParams().getParameters();

Expand Down Expand Up @@ -84,7 +84,7 @@ public class PowerBookmarkShoppingItemRowRenderTest extends DummyUiActivityTestC

public PowerBookmarkShoppingItemRowRenderTest(boolean nightModeEnabled) {
// Sets a fake background color to make the screenshots easier to compare with bare eyes.
NightModeTestUtils.setUpNightModeForDummyUiActivity(nightModeEnabled);
NightModeTestUtils.setUpNightModeForBlankUiTestActivity(nightModeEnabled);
mRenderTestRule.setNightModeEnabled(nightModeEnabled);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@
import org.chromium.components.image_fetcher.ImageFetcher;
import org.chromium.components.payments.CurrencyFormatter;
import org.chromium.content_public.browser.test.util.TestThreadUtils;
import org.chromium.ui.test.util.DummyUiActivityTestCase;
import org.chromium.ui.test.util.BlankUiTestActivityTestCase;

/**
* Tests for the Shopping power bookmarks experience.
*/
@RunWith(ChromeJUnit4ClassRunner.class)
public class PowerBookmarkShoppingItemRowTest extends DummyUiActivityTestCase {
public class PowerBookmarkShoppingItemRowTest extends BlankUiTestActivityTestCase {
private static final long CURRENCY_MUTLIPLIER = 1000000;

@Rule
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@
import org.chromium.chrome.test.ChromeJUnit4ClassRunner;
import org.chromium.chrome.test.util.ChromeRenderTestRule;
import org.chromium.content_public.browser.test.util.TestThreadUtils;
import org.chromium.ui.test.util.DummyUiActivityTestCase;
import org.chromium.ui.test.util.BlankUiTestActivityTestCase;

import java.io.IOException;

/**
* Tests for the power bookmark experience.
*/
@RunWith(ChromeJUnit4ClassRunner.class)
public class PowerBookmarkTagChipListTest extends DummyUiActivityTestCase {
public class PowerBookmarkTagChipListTest extends BlankUiTestActivityTestCase {
@Rule
public ChromeRenderTestRule mRenderTestRule =
ChromeRenderTestRule.Builder.withPublicCorpus().build();
Expand Down
Loading

0 comments on commit e1d37e7

Please sign in to comment.