Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10)

Unified Diff: chrome/android/javatests/src/org/chromium/chrome/browser/ntp/NewTabPageTest.java

Issue 2901053003: 📷 Create RenderTestRule which fails after test method finishes. (Closed)
Patch Set: Typo in comment. Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/android/javatests/src/org/chromium/chrome/browser/ntp/NewTabPageTest.java
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/ntp/NewTabPageTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/ntp/NewTabPageTest.java
index d467487b2de644f283ef2f1e765aa594b0af661b..915df34ae74cd13bfc7911e631ddb16d5937cd2f 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/ntp/NewTabPageTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/ntp/NewTabPageTest.java
@@ -44,7 +44,7 @@ import org.chromium.chrome.test.ChromeTabbedActivityTestRule;
import org.chromium.chrome.test.util.ChromeTabUtils;
import org.chromium.chrome.test.util.NewTabPageTestUtils;
import org.chromium.chrome.test.util.OmniboxTestUtils;
-import org.chromium.chrome.test.util.RenderUtils.ViewRenderer;
+import org.chromium.chrome.test.util.RenderTestRule;
import org.chromium.content.browser.test.util.Criteria;
import org.chromium.content.browser.test.util.CriteriaHelper;
import org.chromium.content.browser.test.util.KeyUtils;
@@ -73,6 +73,9 @@ import java.util.concurrent.TimeUnit;
public class NewTabPageTest {
@Rule
public ChromeTabbedActivityTestRule mActivityTestRule = new ChromeTabbedActivityTestRule();
+ @Rule
+ public RenderTestRule mRenderTestRule =
+ new RenderTestRule("chrome/test/data/android/render_tests");
private static final String TEST_PAGE = "/chrome/test/data/android/navigate/simple.html";
@@ -119,11 +122,9 @@ public class NewTabPageTest {
@MediumTest
@Feature({"NewTabPage", "RenderTest"})
public void testRender() throws IOException {
- ViewRenderer viewRenderer = new ViewRenderer(mActivityTestRule.getActivity(),
- "chrome/test/data/android/render_tests", "NewTabPageTest");
- viewRenderer.renderAndCompare(mTileGridLayout, "most_visited");
- viewRenderer.renderAndCompare(mFakebox, "fakebox");
- viewRenderer.renderAndCompare(mNtp.getView().getRootView(), "new_tab_page");
+ mRenderTestRule.render(mTileGridLayout, "most_visited");
+ mRenderTestRule.render(mFakebox, "fakebox");
+ mRenderTestRule.render(mNtp.getView().getRootView(), "new_tab_page");
// Scroll to search bar
final NewTabPageRecyclerView recyclerView = mNtp.getNewTabPageView().getRecyclerView();
@@ -142,7 +143,7 @@ public class NewTabPageTest {
}
});
- viewRenderer.renderAndCompare(mNtp.getView().getRootView(), "new_tab_page_scrolled");
+ mRenderTestRule.render(mNtp.getView().getRootView(), "new_tab_page_scrolled");
}
@Test

Powered by Google App Engine
This is Rietveld 408576698