@Test public void testMeasure() throws Exception { testLayoutBefore(); MeasureOutput output = new MeasureOutput(); WXTextDomObject mock = PowerMockito.spy(dom); PowerMockito.when(mock,"getTextWidth",dom.getTextPaint(),100f,false).thenReturn(10f); WXTextDomObject.TEXT_MEASURE_FUNCTION.measure(mock,100,output); assertEquals(output.width,10f,0.1f); }
public TextPaint getTextPaint() { return mTextPaint; }
WXTextDomObject extends WXDomObject { public TextPaint getTextPaint() { return mTextPaint; } }
WXTextDomObject extends WXDomObject { public TextPaint getTextPaint() { return mTextPaint; } WXTextDomObject(); }
WXTextDomObject extends WXDomObject { public TextPaint getTextPaint() { return mTextPaint; } WXTextDomObject(); TextPaint getTextPaint(); @Override void layoutBefore(); @Override void layoutAfter(); @Override Layout getExtra(); @Override void updateAttr(Map<String, Object> attrs); @Override void updateStyle(Map<String, Object> styles); @Override WXTextDomObject clone(); @NonNull String truncate(@Nullable String source, @NonNull TextPaint paint,
                                  int desired, @Nullable TextUtils.TruncateAt truncateAt); }
WXTextDomObject extends WXDomObject { public TextPaint getTextPaint() { return mTextPaint; } WXTextDomObject(); TextPaint getTextPaint(); @Override void layoutBefore(); @Override void layoutAfter(); @Override Layout getExtra(); @Override void updateAttr(Map<String, Object> attrs); @Override void updateStyle(Map<String, Object> styles); @Override WXTextDomObject clone(); @NonNull String truncate(@Nullable String source, @NonNull TextPaint paint,
                                  int desired, @Nullable TextUtils.TruncateAt truncateAt);  }