OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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; | 5 package org.chromium.chrome.browser.ntp; |
6 | 6 |
7 import android.graphics.Canvas; | 7 import android.graphics.Canvas; |
8 import android.support.test.filters.LargeTest; | 8 import android.support.test.filters.LargeTest; |
9 import android.support.test.filters.MediumTest; | 9 import android.support.test.filters.MediumTest; |
10 import android.support.test.filters.SmallTest; | 10 import android.support.test.filters.SmallTest; |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
84 | 84 |
85 @Override | 85 @Override |
86 public void startMainActivity() throws InterruptedException { | 86 public void startMainActivity() throws InterruptedException { |
87 startMainActivityOnBlankPage(); | 87 startMainActivityOnBlankPage(); |
88 mTab = getActivity().getActivityTab(); | 88 mTab = getActivity().getActivityTab(); |
89 | 89 |
90 try { | 90 try { |
91 runTestOnUiThread(new Runnable() { | 91 runTestOnUiThread(new Runnable() { |
92 @Override | 92 @Override |
93 public void run() { | 93 public void run() { |
94 // Create FakeMostVisitedSites after starting the activity, since it depends on | 94 // Create FakeMostVisitedSites after starting the activity, since 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.
| |
95 // native code. | 95 // native code. |
96 mMostVisitedSites = new FakeMostVisitedSites(mTab.getProfile ()); | 96 mMostVisitedSites = new FakeMostVisitedSites(); |
97 mMostVisitedSites.setTileSuggestions(FAKE_MOST_VISITED_TITLE S, | 97 mMostVisitedSites.setTileSuggestions(FAKE_MOST_VISITED_TITLE S, |
98 mSiteSuggestionUrls, FAKE_MOST_VISITED_WHITELIST_ICO N_PATHS, | 98 mSiteSuggestionUrls, FAKE_MOST_VISITED_WHITELIST_ICO N_PATHS, |
99 FAKE_MOST_VISITED_SOURCES); | 99 FAKE_MOST_VISITED_SOURCES); |
100 } | 100 } |
101 }); | 101 }); |
102 } catch (Throwable t) { | 102 } catch (Throwable t) { |
103 fail(t.getMessage()); | 103 fail(t.getMessage()); |
104 } | 104 } |
105 TileGroupDelegateImpl.setMostVisitedSitesForTests(mMostVisitedSites); | 105 TileGroupDelegateImpl.setMostVisitedSitesForTests(mMostVisitedSites); |
106 | 106 |
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
535 */ | 535 */ |
536 private void waitForFakeboxTopPosition(final NewTabPage ntp, int position) { | 536 private void waitForFakeboxTopPosition(final NewTabPage ntp, int position) { |
537 CriteriaHelper.pollUiThread(Criteria.equals(position, new Callable<Integ er>() { | 537 CriteriaHelper.pollUiThread(Criteria.equals(position, new Callable<Integ er>() { |
538 @Override | 538 @Override |
539 public Integer call() { | 539 public Integer call() { |
540 return getFakeboxTop(ntp); | 540 return getFakeboxTop(ntp); |
541 } | 541 } |
542 })); | 542 })); |
543 } | 543 } |
544 } | 544 } |
OLD | NEW |