Chromium Code Reviews| Index: chrome/android/junit/src/org/chromium/chrome/browser/suggestions/TileGroupTest.java |
| diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/suggestions/TileGroupTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/suggestions/TileGroupTest.java |
| index 0d365de1c43f2b1ff61604f5e29b74ca48eea575..4114c2ca5aec8b9f7341ae554b923065a7f0438c 100644 |
| --- a/chrome/android/junit/src/org/chromium/chrome/browser/suggestions/TileGroupTest.java |
| +++ b/chrome/android/junit/src/org/chromium/chrome/browser/suggestions/TileGroupTest.java |
| @@ -20,11 +20,8 @@ import static org.mockito.Mockito.verifyNoMoreInteractions; |
| import static org.mockito.Mockito.when; |
| import android.content.Context; |
| -import android.content.res.Resources; |
| import android.graphics.Bitmap; |
| import android.graphics.Color; |
| -import android.support.annotation.ColorRes; |
| -import android.support.annotation.DimenRes; |
| import android.support.annotation.LayoutRes; |
| import android.view.LayoutInflater; |
| import android.view.View; |
| @@ -45,7 +42,6 @@ import org.robolectric.RuntimeEnvironment; |
| import org.robolectric.annotation.Config; |
| import org.robolectric.annotation.Implementation; |
| import org.robolectric.annotation.Implements; |
| -import org.robolectric.shadows.ShadowResources; |
| import org.chromium.base.Callback; |
| import org.chromium.chrome.R; |
| @@ -61,9 +57,7 @@ import org.chromium.testing.local.LocalRobolectricTestRunner; |
| * Unit tests for {@link TileGroup}. |
| */ |
| @RunWith(LocalRobolectricTestRunner.class) |
| -@Config(manifest = Config.NONE, sdk = 21, |
| - shadows = {TileGroupTest.TileShadowResources.class, |
| - TileGroupTest.ShadowLayoutInflater.class}) |
| +@Config(manifest = Config.NONE, sdk = 21, shadows = {TileGroupTest.ShadowLayoutInflater.class}) |
| @Features(@Features.Register(ChromeFeatureList.NTP_OFFLINE_PAGES_FEATURE_NAME)) |
| public class TileGroupTest { |
| private static final int MAX_TILES_TO_FETCH = 4; |
| @@ -413,28 +407,6 @@ public class TileGroupTest { |
| public void destroy() {} |
| } |
| - /** |
| - * Replacement for the {@link Resources} to allow loading resources used by {@link TileGroup} in |
| - * unit tests. |
| - * TODO(https://crbug.com/693573): Needed until unit tests can pick up resources themselves. |
| - */ |
| - @Implements(Resources.class) |
| - public static class TileShadowResources extends ShadowResources { |
| - @Implementation |
| - public int getDimensionPixelSize(@DimenRes int id) { |
| - if (id == R.dimen.tile_view_icon_size) return 48; |
| - |
| - throw new IllegalArgumentException(); |
| - } |
| - |
| - @Implementation |
| - public int getColor(@ColorRes int id) { |
| - if (id == R.color.default_favicon_background_color) return Color.BLACK; |
| - |
| - throw new IllegalArgumentException(); |
| - } |
| - } |
| - |
| /** Intercepts calls to inflate views to replace them with mocks. */ |
| @Implements(LayoutInflater.class) |
| public static class ShadowLayoutInflater { |
|
dgn
2017/03/21 18:16:41
does it work when this one is removed too? AFAICT
mikecase (-- gone --)
2017/03/21 18:39:36
I get an error when I remove this....
Caused by:
dgn
2017/03/22 10:23:47
That's a string used a content description for acc
|