| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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.suggestions; | 5 package org.chromium.chrome.browser.suggestions; |
| 6 | 6 |
| 7 import static org.hamcrest.CoreMatchers.is; | 7 import static org.hamcrest.CoreMatchers.is; |
| 8 import static org.junit.Assert.assertNotNull; | 8 import static org.junit.Assert.assertNotNull; |
| 9 import static org.junit.Assert.assertThat; | 9 import static org.junit.Assert.assertThat; |
| 10 import static org.junit.Assert.fail; | 10 import static org.junit.Assert.fail; |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 import org.chromium.chrome.browser.favicon.LargeIconBridge.LargeIconCallback; | 53 import org.chromium.chrome.browser.favicon.LargeIconBridge.LargeIconCallback; |
| 54 import org.chromium.chrome.browser.ntp.ContextMenuManager; | 54 import org.chromium.chrome.browser.ntp.ContextMenuManager; |
| 55 import org.chromium.chrome.browser.ntp.NTPTileSource; | 55 import org.chromium.chrome.browser.ntp.NTPTileSource; |
| 56 import org.chromium.chrome.browser.offlinepages.OfflinePageBridge; | 56 import org.chromium.chrome.browser.offlinepages.OfflinePageBridge; |
| 57 import org.chromium.testing.local.LocalRobolectricTestRunner; | 57 import org.chromium.testing.local.LocalRobolectricTestRunner; |
| 58 | 58 |
| 59 /** | 59 /** |
| 60 * Unit tests for {@link TileGroup}. | 60 * Unit tests for {@link TileGroup}. |
| 61 */ | 61 */ |
| 62 @RunWith(LocalRobolectricTestRunner.class) | 62 @RunWith(LocalRobolectricTestRunner.class) |
| 63 @Config(manifest = Config.NONE, | 63 @Config(manifest = Config.NONE, sdk = 21, |
| 64 shadows = {TileGroupTest.TileShadowResources.class, | 64 shadows = {TileGroupTest.TileShadowResources.class, |
| 65 TileGroupTest.ShadowLayoutInflater.class}) | 65 TileGroupTest.ShadowLayoutInflater.class}) |
| 66 @Features(@Features.Register(ChromeFeatureList.NTP_OFFLINE_PAGES_FEATURE_NAME)) | 66 @Features(@Features.Register(ChromeFeatureList.NTP_OFFLINE_PAGES_FEATURE_NAME)) |
| 67 public class TileGroupTest { | 67 public class TileGroupTest { |
| 68 private static final int MAX_TILES_TO_FETCH = 4; | 68 private static final int MAX_TILES_TO_FETCH = 4; |
| 69 private static final int TILE_TITLE_LINES = 1; | 69 private static final int TILE_TITLE_LINES = 1; |
| 70 private static final String[] URLS = {"https://www.google.com", "https://tel
lmedadjokes.com"}; | 70 private static final String[] URLS = {"https://www.google.com", "https://tel
lmedadjokes.com"}; |
| 71 | 71 |
| 72 @Rule | 72 @Rule |
| 73 public Features.Processor mFeaturesProcessor = new Features.Processor(); | 73 public Features.Processor mFeaturesProcessor = new Features.Processor(); |
| (...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 409 @LayoutRes | 409 @LayoutRes |
| 410 int layoutId = invocation.getArgument(0); | 410 int layoutId = invocation.getArgument(0); |
| 411 if (layoutId != R.layout.tile_view) fail("Unexpected
resource id."); | 411 if (layoutId != R.layout.tile_view) fail("Unexpected
resource id."); |
| 412 return createMockTileView(); | 412 return createMockTileView(); |
| 413 } | 413 } |
| 414 }); | 414 }); |
| 415 return layoutInflater; | 415 return layoutInflater; |
| 416 } | 416 } |
| 417 } | 417 } |
| 418 } | 418 } |
| OLD | NEW |