当前位置: 首页>>代码示例>>Java>>正文


Java IdlingResource.ResourceCallback方法代码示例

本文整理汇总了Java中android.support.test.espresso.IdlingResource.ResourceCallback方法的典型用法代码示例。如果您正苦于以下问题:Java IdlingResource.ResourceCallback方法的具体用法?Java IdlingResource.ResourceCallback怎么用?Java IdlingResource.ResourceCallback使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.support.test.espresso.IdlingResource的用法示例。


在下文中一共展示了IdlingResource.ResourceCallback方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: idleCallback

import android.support.test.espresso.IdlingResource; //导入方法依赖的package包/类
@Test public void idleCallback() throws InterruptedException, IOException {
  server.enqueue(new MockResponse());

  OkHttpClient client = new OkHttpClient();
  IdlingResource idlingResource = OkHttp3IdlingResource.create("Ok!", client);

  final AtomicInteger count = new AtomicInteger();
  IdlingResource.ResourceCallback callback = new IdlingResource.ResourceCallback() {
    @Override public void onTransitionToIdle() {
      count.getAndIncrement();
    }
  };
  idlingResource.registerIdleTransitionCallback(callback);

  assertThat(count.get()).isEqualTo(0);

  // Use a synchronous call as a quick way to transition from busy to idle in a blocking way.
  client.newCall(new Request.Builder().url(server.url("/")).build()).execute().close();
  assertThat(count.get()).isEqualTo(1);
}
 
开发者ID:JakeWharton,项目名称:okhttp-idling-resource,代码行数:21,代码来源:OkHttp3IdlingResourceTest.java

示例2: onIdle

import android.support.test.espresso.IdlingResource; //导入方法依赖的package包/类
@Override
protected void onIdle() {
    super.onIdle();
    for (IdlingResource.ResourceCallback callback : callbacks) {
        callback.onTransitionToIdle();
    }
}
 
开发者ID:googlesamples,项目名称:android-architecture-components,代码行数:8,代码来源:TaskExecutorWithIdlingResourceRule.java

示例3: registerIdleTransitionCallback

import android.support.test.espresso.IdlingResource; //导入方法依赖的package包/类
@Override
public void registerIdleTransitionCallback(
        IdlingResource.ResourceCallback resourceCallback) {
    this.resourceCallback = resourceCallback;
}
 
开发者ID:DimaKoz,项目名称:meat-grinder,代码行数:6,代码来源:MainActivityTest.java

示例4: registerIdleTransitionCallback

import android.support.test.espresso.IdlingResource; //导入方法依赖的package包/类
@Override
public void registerIdleTransitionCallback(IdlingResource.ResourceCallback resourceCallback) {
  this.resourceCallback = resourceCallback;
}
 
开发者ID:eurosecom,项目名称:Attendance,代码行数:5,代码来源:DgAeaActivityTest.java

示例5: registerIdleTransitionCallback

import android.support.test.espresso.IdlingResource; //导入方法依赖的package包/类
@Override
public void registerIdleTransitionCallback(IdlingResource.ResourceCallback resourceCallback) {
	this.resourceCallback = resourceCallback;
}
 
开发者ID:TakuSemba,项目名称:EspressoDemo,代码行数:5,代码来源:ElapsedTimeIdlingResource.java

示例6: registerIdleTransitionCallback

import android.support.test.espresso.IdlingResource; //导入方法依赖的package包/类
@Override
public void registerIdleTransitionCallback(IdlingResource.ResourceCallback callback) {
  resourceCallback = callback;
}
 
开发者ID:material-components,项目名称:material-components-android,代码行数:5,代码来源:BottomSheetBehaviorTest.java


注:本文中的android.support.test.espresso.IdlingResource.ResourceCallback方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。