private void measureAndLayout() {
    final Throwable[] exceptions = new Throwable[1];
    InstrumentationRegistry.getInstrumentation()
        .runOnMainSync(
            new Runnable() {
              public void run() {
                try {
                  mTextView.measure(
                      View.MeasureSpec.makeMeasureSpec(WIDTH, View.MeasureSpec.EXACTLY),
                      View.MeasureSpec.makeMeasureSpec(HEIGHT, View.MeasureSpec.EXACTLY));
                  mTextView.layout(
                      0, 0, mTextView.getMeasuredWidth(), mTextView.getMeasuredHeight());
                } catch (Throwable throwable) {
                  exceptions[0] = throwable;
                }
              }
            });
    if (exceptions[0] != null) {
      throw new RuntimeException(exceptions[0]);
    }
  }
This is not really a test, this test is just a "fixture" for all the tests for the scripts
related to running tests and getting screenshots.
core/src/androidTest/java/com/facebook/testing/screenshot/ScriptsFixtureTest.java