Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1010)

Unified Diff: chrome/android/junit/src/org/chromium/chrome/browser/ntp/cards/NewTabPageAdapterTest.java

Issue 2723003010: 📰 Throw when unregistered feature is queried in tests (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/android/junit/src/org/chromium/chrome/browser/ntp/cards/NewTabPageAdapterTest.java
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/ntp/cards/NewTabPageAdapterTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/ntp/cards/NewTabPageAdapterTest.java
index f8fda0fddf6c0b9dfa2f981885884da21a1bbe8d..a3f36740f56e0e4e22b91349c427635d945ced5a 100644
--- a/chrome/android/junit/src/org/chromium/chrome/browser/ntp/cards/NewTabPageAdapterTest.java
+++ b/chrome/android/junit/src/org/chromium/chrome/browser/ntp/cards/NewTabPageAdapterTest.java
@@ -53,6 +53,7 @@
import org.chromium.chrome.R;
import org.chromium.chrome.browser.ChromeFeatureList;
import org.chromium.chrome.browser.DisableHistogramsRule;
+import org.chromium.chrome.browser.Features;
import org.chromium.chrome.browser.ntp.ContextMenuManager;
import org.chromium.chrome.browser.ntp.cards.SignInPromo.SigninObserver;
import org.chromium.chrome.browser.ntp.snippets.CategoryInt;
@@ -80,10 +81,14 @@
*/
@RunWith(LocalRobolectricTestRunner.class)
@Config(manifest = Config.NONE)
+@Features(@Features.Register(value = ChromeFeatureList.NTP_CONDENSED_LAYOUT, enabled = false))
public class NewTabPageAdapterTest {
@Rule
public DisableHistogramsRule mDisableHistogramsRule = new DisableHistogramsRule();
+ @Rule
+ public Features.Processor mFeatureProcessor = new Features.Processor();
+
@CategoryInt
private static final int TEST_CATEGORY = 42;
@@ -195,8 +200,6 @@ public void setUp() {
// Set empty variation params for the test.
CardsVariationParameters.setTestVariationParams(new HashMap<String, String>());
- ChromeFeatureList.setTestEnabledFeatures(Collections.<String>emptySet());
-
// Initialise the sign in state. We will be signed in by default in the tests.
assertFalse(ChromePreferenceManager.getInstance().getNewTabPageSigninPromoDismissed());
SigninManager.setInstanceForTesting(mMockSigninManager);
@@ -217,7 +220,6 @@ public void setUp() {
@After
public void tearDown() {
CardsVariationParameters.setTestVariationParams(null);
- ChromeFeatureList.setTestEnabledFeatures(null);
SigninManager.setInstanceForTesting(null);
ChromePreferenceManager.getInstance().setNewTabPageSigninPromoDismissed(false);
}

Powered by Google App Engine
This is Rietveld 408576698