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

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

Issue 2520443002: Make AllDismissedItem and Footer optional leaves. (Closed)
Patch Set: comments Created 4 years, 1 month 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
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/NewTabPageAdapter.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 c49b1dcf573f00ac51ab3ec0c6ca0eed40198fcc..8ee0000e54f834447760b3299e606575be8eb9af 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
@@ -635,7 +635,8 @@ public class NewTabPageAdapterTest {
@Test
@Feature({"Ntp"})
public void testCategoryOrder() {
- final int basicChildCount = 4; // above-the-fold, sign in promo, footer, spacer.
+ // Above-the-fold, sign in promo, all-dismissed, footer, spacer.
+ final int basicChildCount = 5;
FakeSuggestionsSource suggestionsSource = new FakeSuggestionsSource();
registerCategory(suggestionsSource, KnownCategories.ARTICLES, 0);
registerCategory(suggestionsSource, KnownCategories.BOOKMARKS, 0);
@@ -861,12 +862,11 @@ public class NewTabPageAdapterTest {
ChromePreferenceManager.getInstance(RuntimeEnvironment.application)
.setNewTabPageSigninPromoDismissed(false);
- // TODO(peconn)
NewTabPageAdapter adapter =
new NewTabPageAdapter(mNewTabPageManager, null, null, mOfflinePageBridge);
- final int signInPromoIndex = 5;
+ final int signInPromoIndex = adapter.getFirstPositionForType(ItemViewType.PROMO);
- assertEquals(5, adapter.getChildren().size());
+ assertEquals(6, adapter.getChildren().size());
TreeNode signinPromo = adapter.getChildren().get(2);
// Adapter content:
@@ -878,8 +878,9 @@ public class NewTabPageAdapterTest {
// 3 | Action | 1
// 4 | Progress Indicator | 1
// 5 | Sign in promo | 2
- // 6 | Footer | 3
- // 7 | Spacer | 4
+ // 6 | All dismissed | 3
+ // 7 | Footer | 4
+ // 8 | Spacer | 5
assertEquals(ItemViewType.PROMO, signinPromo.getItemViewType(0));
@@ -889,7 +890,7 @@ public class NewTabPageAdapterTest {
.getNewTabPageSigninPromoDismissed());
adapter = new NewTabPageAdapter(mNewTabPageManager, null, null, mOfflinePageBridge);
- assertEquals(5, adapter.getChildren().size());
+ assertEquals(6, adapter.getChildren().size());
// The items below the signin promo move up, footer is now at the position of the promo.
assertEquals(ItemViewType.FOOTER, adapter.getItemViewType(signInPromoIndex));
}
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/NewTabPageAdapter.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698