OLD | NEW |
---|---|
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 package org.chromium.chrome.browser.ntp.cards; | 5 package org.chromium.chrome.browser.ntp.cards; |
6 | 6 |
7 import android.content.res.Resources; | 7 import android.content.res.Resources; |
8 import android.support.test.filters.MediumTest; | 8 import android.support.test.filters.MediumTest; |
9 import android.support.v7.widget.RecyclerView; | 9 import android.support.v7.widget.RecyclerView; |
10 import android.support.v7.widget.RecyclerView.ViewHolder; | 10 import android.support.v7.widget.RecyclerView.ViewHolder; |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
96 } | 96 } |
97 | 97 |
98 @Override | 98 @Override |
99 public void startMainActivity() throws InterruptedException { | 99 public void startMainActivity() throws InterruptedException { |
100 startMainActivityOnBlankPage(); | 100 startMainActivityOnBlankPage(); |
101 mTab = getActivity().getActivityTab(); | 101 mTab = getActivity().getActivityTab(); |
102 | 102 |
103 ThreadUtils.runOnUiThreadBlocking(new Runnable() { | 103 ThreadUtils.runOnUiThreadBlocking(new Runnable() { |
104 @Override | 104 @Override |
105 public void run() { | 105 public void run() { |
106 // Create FakeMostVisitedSites after starting the activity, sinc e it depends on | 106 // Create FakeMostVisitedSites after starting the activity, sinc e it depends on |
Michael van Ouwerkerk
2017/03/20 11:10:18
This is no longer true, please fix.
dgn
2017/03/20 16:06:44
Done.
| |
107 // native code. | 107 // native code. |
108 mMostVisitedSites = new FakeMostVisitedSites(mTab.getProfile()); | 108 mMostVisitedSites = new FakeMostVisitedSites(); |
109 mMostVisitedSites.setTileSuggestions(FAKE_MOST_VISITED_TITLES, m SiteSuggestionUrls, | 109 mMostVisitedSites.setTileSuggestions(FAKE_MOST_VISITED_TITLES, m SiteSuggestionUrls, |
110 FAKE_MOST_VISITED_WHITELIST_ICON_PATHS, FAKE_MOST_VISITE D_SOURCES); | 110 FAKE_MOST_VISITED_WHITELIST_ICON_PATHS, FAKE_MOST_VISITE D_SOURCES); |
111 } | 111 } |
112 }); | 112 }); |
113 TileGroupDelegateImpl.setMostVisitedSitesForTests(mMostVisitedSites); | 113 TileGroupDelegateImpl.setMostVisitedSitesForTests(mMostVisitedSites); |
114 | 114 |
115 loadUrl(UrlConstants.NTP_URL); | 115 loadUrl(UrlConstants.NTP_URL); |
116 NewTabPageTestUtils.waitForNtpLoaded(mTab); | 116 NewTabPageTestUtils.waitForNtpLoaded(mTab); |
117 | 117 |
118 assertTrue(mTab.getNativePage() instanceof NewTabPage); | 118 assertTrue(mTab.getNativePage() instanceof NewTabPage); |
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
416 TestTouchUtils.longClickView(getInstrumentation(), view); | 416 TestTouchUtils.longClickView(getInstrumentation(), view); |
417 assertTrue( | 417 assertTrue( |
418 getInstrumentation().invokeContextMenuAction(getActivity(), cont extMenuItemId, 0)); | 418 getInstrumentation().invokeContextMenuAction(getActivity(), cont extMenuItemId, 0)); |
419 } | 419 } |
420 | 420 |
421 | 421 |
422 private static void assertArrayEquals(int[] expected, int[] actual) { | 422 private static void assertArrayEquals(int[] expected, int[] actual) { |
423 assertEquals(Arrays.toString(expected), Arrays.toString(actual)); | 423 assertEquals(Arrays.toString(expected), Arrays.toString(actual)); |
424 } | 424 } |
425 } | 425 } |
OLD | NEW |