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

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

Issue 2706063002: 📰 Make the section dismissal range dynamic (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
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/SuggestionsSection.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/SuggestionsSectionTest.java
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/ntp/cards/SuggestionsSectionTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/ntp/cards/SuggestionsSectionTest.java
index c2fe9dc509fb2dcefdc1d4703b09ce0e0f5f27a7..31302ff90b34fb29f3fac0c14997f1cc500a9264 100644
--- a/chrome/android/junit/src/org/chromium/chrome/browser/ntp/cards/SuggestionsSectionTest.java
+++ b/chrome/android/junit/src/org/chromium/chrome/browser/ntp/cards/SuggestionsSectionTest.java
@@ -118,6 +118,38 @@ public void testDismissSibling() {
@Test
@Feature({"Ntp"})
+ public void testGetDismissalGroupWithoutHeader() {
+ SuggestionsSection section = createSectionWithFetchAction(true);
+ section.setHeaderVisibility(false);
+
+ assertEquals(ItemViewType.STATUS, section.getItemViewType(0));
+ assertEquals(setOf(0, 1), section.getItemDismissalGroup(0));
+
+ assertEquals(ItemViewType.ACTION, section.getItemViewType(1));
+ assertEquals(setOf(0, 1), section.getItemDismissalGroup(1));
+ }
+
+ @Test
+ @Feature({"Ntp"})
+ public void testGetDismissalGroupWithoutAction() {
+ SuggestionsSection section = createSectionWithFetchAction(false);
+
+ assertEquals(ItemViewType.STATUS, section.getItemViewType(1));
+ assertEquals(Collections.singleton(1), section.getItemDismissalGroup(1));
+ }
+
+ @Test
+ @Feature({"Ntp"})
+ public void testGetDismissalGroupActionAndHeader() {
+ SuggestionsSection section = createSectionWithFetchAction(false);
+ section.setHeaderVisibility(false);
+
+ assertEquals(ItemViewType.STATUS, section.getItemViewType(0));
+ assertEquals(Collections.singleton(0), section.getItemDismissalGroup(0));
+ }
+
+ @Test
+ @Feature({"Ntp"})
public void testAddSuggestionsNotification() {
final int suggestionCount = 5;
List<SnippetArticle> snippets = createDummySuggestions(suggestionCount,
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/SuggestionsSection.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698