Skip to content

Commit

Permalink
[CSN] Filter some groups
Browse files Browse the repository at this point in the history
Filter some groups coming from the results extractor.

Change-Id: Id5a325cb56d30157a26eeb0636fc39b8c2834b2f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2939839
Reviewed-by: Yashar Dabiran <yashard@chromium.org>
Commit-Queue: Calder Kitagawa <ckitagawa@chromium.org>
Cr-Commit-Position: refs/heads/master@{#889816}
  • Loading branch information
ckitagawa-work authored and Chromium LUCI CQ committed Jun 7, 2021
1 parent cfadf91 commit f3adf5f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ void onResultsAvailable(GURL url, String query, int resultCategory, String[] gro
int urlCount = 0;
List<PageGroup> groups = new ArrayList<PageGroup>();
for (int i = 0; i < groupLabel.length; i++) {
if (isAdGroup[i]) continue;

List<PageItem> results = new ArrayList<PageItem>();
Set<GURL> groupUrls = new HashSet<>();
for (int j = 0; j < groupSize[i]; j++) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,13 @@ private void finishFetching(boolean cancelled) {
GURL url2 = JUnitTestGURLs.getGURL(JUnitTestGURLs.BLUE_1);
GURL url3 = JUnitTestGURLs.getGURL(JUnitTestGURLs.BLUE_2);
GURL url4 = JUnitTestGURLs.getGURL(JUnitTestGURLs.BLUE_3);
GURL url5 = JUnitTestGURLs.getGURL(JUnitTestGURLs.EXAMPLE_URL);

mSearchResultProducer.onResultsAvailable(mTestUrl, TEST_QUERY, TEST_RESULT_TYPE,
new String[] {"Foo", "Bar"}, new boolean[] {false, true}, new int[] {1, 3},
new String[] {"Foo.com 1", "Bar.com 1", "Bar.com 2", "Bar.com 3"},
new GURL[] {url1, url2, url3, url4});
new String[] {"Foo", "Bar", "Baz"}, new boolean[] {false, false, true},
new int[] {1, 3, 1},
new String[] {"Foo.com 1", "Bar.com 1", "Bar.com 2", "Bar.com 3", "Baz.com 1"},
new GURL[] {url1, url2, url3, url4, url5});

if (cancelled) {
verify(mListenerMock, never()).onResult(any());
Expand All @@ -110,7 +112,7 @@ private void finishFetching(boolean cancelled) {
results2.add(new PageItem(url2, "Bar.com 1"));
results2.add(new PageItem(url3, "Bar.com 2"));
results2.add(new PageItem(url4, "Bar.com 3"));
groups.add(new PageGroup("Bar", true, results2));
groups.add(new PageGroup("Bar", false, results2));

verify(mListenerMock, times(1))
.onResult(new ContinuousNavigationMetadata(
Expand Down

0 comments on commit f3adf5f

Please sign in to comment.