private static void assertNotTooLarge(int width, int height, RecordBuilderImpl recordBuilder) {
    final long maxPixels = recordBuilder.getMaxPixels();
    if (maxPixels <= 0) {
      return;
    }
    if (((long) width) * height > maxPixels) {
      throw new IllegalStateException(
          String.format(Locale.US, "View too large: (%d, %d)", width, height));
    }
  }
Snaps a screenshot of the view (which should already be measured and layouted) using testName
as the name.
core/src/main/java/com/facebook/testing/screenshot/internal/ScreenshotImpl.java