本文整理汇总了Java中org.robolectric.shadows.ShadowBitmapFactory.provideWidthAndHeightHints方法的典型用法代码示例。如果您正苦于以下问题:Java ShadowBitmapFactory.provideWidthAndHeightHints方法的具体用法?Java ShadowBitmapFactory.provideWidthAndHeightHints怎么用?Java ShadowBitmapFactory.provideWidthAndHeightHints使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.robolectric.shadows.ShadowBitmapFactory
的用法示例。
在下文中一共展示了ShadowBitmapFactory.provideWidthAndHeightHints方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: itGeneratesLivePreview
import org.robolectric.shadows.ShadowBitmapFactory; //导入方法依赖的package包/类
@Test
public void itGeneratesLivePreview () throws Exception {
this.alert.show();
this.dlg.updateSummary();
final TextView txtSummary = (TextView) this.shadowAlert.getView().findViewById(R.id.txtSummary);
ShadowBitmapFactory.provideWidthAndHeightHints(this.attachment, 72, 72);
// Note above does not actually have any effect,
// since dimensions are read via BitmapFactory.decodeFileDescriptor().
// 100x100 is ShadowBitmapFactory's default.
final String expectedStatus = "100 x 100 (3.4 KB) --> 36 x 36 (69 B)";
int n = 0;
while (true) {
if (expectedStatus.equals(txtSummary.getText().toString())) break;
if (n > 5) fail("Expected '" + txtSummary.getText() + "' to be '" + expectedStatus + "' after " + n + " seconds.");
n++;
Thread.sleep(1000L);
}
// TODO assert img in UI is set.
}