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

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

Issue 2162093002: Rename SnippetArticle to SnippetArticleListItem for consistency. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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_sources.gni ('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 048b85e22a44cd0fb7ceff98b601ba594d9ac8a9..21c09f24286f2560597eb604d4d2087439401226 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
@@ -13,7 +13,7 @@
import org.chromium.base.test.util.Feature;
import org.chromium.chrome.browser.ntp.NewTabPageView.NewTabPageManager;
import org.chromium.chrome.browser.ntp.snippets.DisabledReason;
-import org.chromium.chrome.browser.ntp.snippets.SnippetArticle;
+import org.chromium.chrome.browser.ntp.snippets.SnippetArticleListItem;
import org.chromium.chrome.browser.ntp.snippets.SnippetsBridge;
import org.chromium.chrome.browser.ntp.snippets.SnippetsBridge.SnippetsObserver;
import org.chromium.testing.local.LocalRobolectricTestRunner;
@@ -71,7 +71,7 @@ public void testSnippetLoading() {
assertEquals(NewTabPageListItem.VIEW_TYPE_STATUS, ntpa.getItemViewType(2));
assertEquals(NewTabPageListItem.VIEW_TYPE_SPACING, ntpa.getItemViewType(3));
- List<SnippetArticle> snippets = createDummySnippets();
+ List<SnippetArticleListItem> snippets = createDummySnippets();
mSnippetsObserver.onSnippetsReceived(snippets);
List<NewTabPageListItem> loadedItems = new ArrayList<>(ntpa.getItemsForTesting());
@@ -82,8 +82,9 @@ public void testSnippetLoading() {
NewTabPageListItem.VIEW_TYPE_SPACING, ntpa.getItemViewType(loadedItems.size() - 1));
// The adapter should ignore any new incoming data.
- mSnippetsObserver.onSnippetsReceived(Arrays.asList(new SnippetArticle[] {
- new SnippetArticle("foo", "title1", "pub1", "txt1", "foo", "bar", null, 0, 0, 0)}));
+ mSnippetsObserver.onSnippetsReceived(
+ Arrays.asList(new SnippetArticleListItem[] {new SnippetArticleListItem(
+ "foo", "title1", "pub1", "txt1", "foo", "bar", null, 0, 0, 0)}));
assertEquals(loadedItems, ntpa.getItemsForTesting());
}
@@ -97,7 +98,7 @@ public void testSnippetLoadingInitiallyEmpty() {
NewTabPageAdapter ntpa = new NewTabPageAdapter(mNewTabPageManager, null, mSnippetsBridge);
// If we don't get anything, we should be in the same situation as the initial one.
- mSnippetsObserver.onSnippetsReceived(new ArrayList<SnippetArticle>());
+ mSnippetsObserver.onSnippetsReceived(new ArrayList<SnippetArticleListItem>());
assertEquals(4, ntpa.getItemCount());
assertEquals(NewTabPageListItem.VIEW_TYPE_ABOVE_THE_FOLD, ntpa.getItemViewType(0));
assertEquals(NewTabPageListItem.VIEW_TYPE_HEADER, ntpa.getItemViewType(1));
@@ -105,7 +106,7 @@ public void testSnippetLoadingInitiallyEmpty() {
assertEquals(NewTabPageListItem.VIEW_TYPE_SPACING, ntpa.getItemViewType(3));
// We should load new snippets when we get notified about them.
- List<SnippetArticle> snippets = createDummySnippets();
+ List<SnippetArticleListItem> snippets = createDummySnippets();
mSnippetsObserver.onSnippetsReceived(snippets);
List<NewTabPageListItem> loadedItems = new ArrayList<>(ntpa.getItemsForTesting());
assertEquals(NewTabPageListItem.VIEW_TYPE_ABOVE_THE_FOLD, ntpa.getItemViewType(0));
@@ -115,8 +116,9 @@ public void testSnippetLoadingInitiallyEmpty() {
NewTabPageListItem.VIEW_TYPE_SPACING, ntpa.getItemViewType(loadedItems.size() - 1));
// The adapter should ignore any new incoming data.
- mSnippetsObserver.onSnippetsReceived(Arrays.asList(new SnippetArticle[] {
- new SnippetArticle("foo", "title1", "pub1", "txt1", "foo", "bar", null, 0, 0, 0)}));
+ mSnippetsObserver.onSnippetsReceived(
+ Arrays.asList(new SnippetArticleListItem[] {new SnippetArticleListItem(
+ "foo", "title1", "pub1", "txt1", "foo", "bar", null, 0, 0, 0)}));
assertEquals(loadedItems, ntpa.getItemsForTesting());
}
@@ -128,7 +130,7 @@ public void testSnippetLoadingInitiallyEmpty() {
public void testSnippetClearing() {
NewTabPageAdapter ntpa = new NewTabPageAdapter(mNewTabPageManager, null, mSnippetsBridge);
- List<SnippetArticle> snippets = createDummySnippets();
+ List<SnippetArticleListItem> snippets = createDummySnippets();
mSnippetsObserver.onSnippetsReceived(snippets);
assertEquals(3 + snippets.size(), ntpa.getItemCount());
@@ -141,13 +143,13 @@ public void testSnippetClearing() {
assertEquals(3 + snippets.size(), ntpa.getItemCount());
}
- private List<SnippetArticle> createDummySnippets() {
- return Arrays.asList(new SnippetArticle[] {
- new SnippetArticle("https://site.com/url1", "title1", "pub1", "txt1",
+ private List<SnippetArticleListItem> createDummySnippets() {
+ return Arrays.asList(new SnippetArticleListItem[] {
+ new SnippetArticleListItem("https://site.com/url1", "title1", "pub1", "txt1",
"https://site.com/url1", "https://amp.site.com/url1", null, 0, 0, 0),
- new SnippetArticle("https://site.com/url2", "title2", "pub2", "txt2",
+ new SnippetArticleListItem("https://site.com/url2", "title2", "pub2", "txt2",
"https://site.com/url2", "https://amp.site.com/url1", null, 0, 0, 0),
- new SnippetArticle("https://site.com/url3", "title3", "pub3", "txt3",
+ new SnippetArticleListItem("https://site.com/url3", "title3", "pub3", "txt3",
"https://site.com/url3", "https://amp.site.com/url1", null, 0, 0, 0)});
}
}
« no previous file with comments | « chrome/android/java_sources.gni ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698